public interface ByteWriter extends ByteReader
The ByteWriter provides an abstraction to a linear, zero-based, semi-infinite
array of bytes that can be read from at any point. The actual repository can store
these bytes in any manner that best fits the storage medium but the view on them
provided by this interface must be as above.
EOF| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Flushes this
ByteWriter and forces any unwritten buffered output bytes
to be written out to the underlying repository. |
void |
write(long position,
byte[] b,
int offset,
int length)
Write an array of bytes at the position given.
|
void |
write(long position,
int b)
Write the byte given at the position given.
|
close, length, read, readvoid write(long position,
int b)
throws IOException
length of virtual array = max(length of virtual array, position of byte written + 1)position - the zero-based offset within the byte array.b - the byte to write.IOException - if an error occurs during the write operationvoid write(long position,
byte[] b,
int offset,
int length)
throws IOException
length of virtual array = max(length of virtual array, position of byte written + 1)position - the zero-based offset within the byte array.b - the array of bytes to write from.offset - the offset within the byte array to start writing from.length - the number of bytes to write from the byte array.IOException - if an error occurs during the write operationvoid flush()
throws IOException
ByteWriter and forces any unwritten buffered output bytes
to be written out to the underlying repository.IOException - if an error occurs while trying to flush the bufferCopyright © 2010 - 2020 Adobe. All Rights Reserved