| Constructor and Description |
|---|
MemoryResidentStream(ByteBuffer existingBuffer) |
MemoryResidentStream(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
MemoryResidentStream |
clone()
Create a cloned copy of the underlying stream accessor class.
|
void |
close()
Close the stream and release any associated systems resources.
|
boolean |
equals(Object o) |
void |
finalize() |
static void |
generateStreamORM(Node parent,
String namespace,
String prefix) |
ByteOrder |
getByteOrder()
Returns the byte order of the stream.
|
int |
getCapacity() |
long |
getLength()
Returns the length of the stream, measured in bytes.
|
long |
getLimit()
Gets the limit position beyond which content cannot be read or written.
|
long |
getPersistentID() |
long |
getPosition()
Returns the current position for reading from or writing to the stream.
|
long |
getStart() |
URI |
getStreamURI()
Returns the URI that specifies the location of this stream.
|
int |
hashCode() |
ByteBuffer |
read(int bytes)
Read the number of bytes requested from the stream into a newly created byte
buffer.
|
void |
setByteOrder(ByteOrder byteOrder) |
void |
setLimit(long limit)
Sets the limit position beyond which content cannot be read or written.
|
void |
setPosition(long position)
Sets the current position for reading from or writing to the stream.
|
int |
write(ByteBuffer bytes)
Write the number of bytes requested to the stream from the given byte buffer.
|
public MemoryResidentStream(int capacity)
throws IllegalArgumentException
IllegalArgumentExceptionpublic MemoryResidentStream(ByteBuffer existingBuffer) throws NullPointerException
NullPointerExceptionpublic ByteBuffer read(int bytes) throws EndOfDataException, IOException, IllegalArgumentException
StreamRead the number of bytes requested from the stream into a newly created byte buffer.
read in interface Streambytes - Number of bytes to read.EndOfDataException - Attempt to read beyond the limit set for the stream.IOException - An IO problem occurred when trying to read from the stream.IllegalArgumentException - Cannot read a negative number of bytes.Stream.write(ByteBuffer),
Stream.getLimit(),
Stream.getPosition()public long getPosition()
throws IOException
StreamReturns the current position for reading from or writing to the stream.
getPosition in interface StreamIOException - An IO problem occurred when trying to access the stream.Stream.setPosition(long)public void setPosition(long position)
throws IllegalArgumentException,
IOException
StreamSets the current position for reading from or writing to the stream.
setPosition in interface Streamposition - Current position for reading from or writing to the stream.IllegalArgumentException - Cannot set a stream position to a negative value or
beyond the limit set for the stream.IOException - An IO problem occurred when trying to access the stream.Stream.getPosition(),
Stream.getLimit()public int write(ByteBuffer bytes) throws EndOfDataException, IOException
StreamWrite the number of bytes requested to the stream from the given byte buffer.
write in interface Streambytes - Buffer of data to write. Data is written from the current position to the
limit set for the given buffer.EndOfDataException - Attempt to write beyond the limit set for the stream.IOException - An IO problem occurred when trying to write to the stream.Stream.read(int),
Stream.getPosition(),
Stream.getLimit()public long getStart()
public long getLimit()
StreamGets the limit position beyond which content cannot be read or written.
getLimit in interface StreamStream.setLimit(long)public long getLength()
StreamReturns the length of the stream, measured in bytes.
public long getPersistentID()
public void close()
StreamClose the stream and release any associated systems resources.
public MemoryResidentStream clone()
StreamCreate a cloned copy of the underlying stream accessor class.
public void setLimit(long limit)
throws IllegalArgumentException
StreamSets the limit position beyond which content cannot be read or written.
setLimit in interface Streamlimit - Limit position beyond which content cannot be read or written.IllegalArgumentException - The limit position cannot set beyond the end
of the stream.public int getCapacity()
public static final void generateStreamORM(Node parent, String namespace, String prefix)
public URI getStreamURI()
StreamReturns the URI that specifies the location of this stream. The URI can be used to resolve the stream and includes just enough information that the stream can be opened and read or written. For example, an AAF stream contains the structured storage path within the file where the stream can be accessed, whereas an MXF stream contains the body and index stream identifiers.
getStreamURI in interface StreamStreamResolverpublic ByteOrder getByteOrder()
StreamReturns the byte order of the stream.
getByteOrder in interface Streampublic void setByteOrder(ByteOrder byteOrder)
(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.