|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RandomAccessBinary
Random access binary is a interface to access a binary object (BLOB). Binary object is random accessible and has a length. It can be read and written, enlarged and shrunk at any position.
There is a pointer which moves on every read and write operation. It can
moved with position()
. If bytes are written and the pointer is
moved outside the blob or moves while writing, the blob is enlarged.
Cascading implementation
,
RandomAccessFile implementation
,
java.util.List implementation
Method Summary | |
---|---|
void |
close()
Flush and close the blob. |
void |
flush()
Flush write buffer |
byte |
get()
|
void |
get(byte[] dst)
|
void |
get(byte[] dst,
int offset,
int length)
|
void |
get(java.nio.ByteBuffer buf)
Get buf fully |
void |
get(java.nio.ByteBuffer buf,
int length)
Get fully length bytes |
double |
getDouble()
|
float |
getFloat()
|
int |
getInt()
|
long |
getLong()
|
short |
getShort()
|
void |
insertBytes(long bytes)
Insert bytes at current pointer. |
long |
length()
Get the length of the binary object. |
java.nio.ByteOrder |
order()
Get byte order |
void |
order(java.nio.ByteOrder order)
Set a new byte order |
long |
position()
Get the position of the cursor |
void |
position(long newPosition)
Set new cursor position. |
void |
put(byte b)
Write a byte |
void |
put(byte[] src)
|
void |
put(byte[] src,
int offset,
int length)
|
void |
put(java.nio.ByteBuffer src)
Put n bytes from the remaining of the byte array. |
void |
put(java.nio.ByteBuffer src,
int length)
Put n bytes from the remaining of the byte buffer. |
void |
putDouble(double value)
|
void |
putFloat(float value)
|
void |
putInt(int value)
|
void |
putLong(long value)
|
void |
putShort(short value)
|
void |
removeBytes(long bytes)
Remove bytes from the position of the current pointer. |
void |
setLength(long newLength)
Set length of the binary object. |
void |
skip(long bytes)
Move pointer forward |
Method Detail |
---|
void put(byte b) throws java.io.IOException
put
in interface BinaryWriteable
b
-
java.io.IOException
void put(java.nio.ByteBuffer src) throws java.io.IOException
put
in interface BinaryWriteable
src
-
java.io.IOException
void put(java.nio.ByteBuffer src, int length) throws java.io.IOException
put
in interface BinaryWriteable
src
- length
-
java.io.IOException
void put(byte[] src, int offset, int length) throws java.io.IOException
put
in interface BinaryWriteable
java.io.IOException
void put(byte[] src) throws java.io.IOException
put
in interface BinaryWriteable
java.io.IOException
void putShort(short value) throws java.io.IOException
putShort
in interface BinaryWriteable
java.io.IOException
void putInt(int value) throws java.io.IOException, java.lang.IndexOutOfBoundsException
putInt
in interface BinaryWriteable
java.io.IOException
java.lang.IndexOutOfBoundsException
void putLong(long value) throws java.io.IOException
putLong
in interface BinaryWriteable
java.io.IOException
void putFloat(float value) throws java.io.IOException
putFloat
in interface BinaryWriteable
java.io.IOException
void putDouble(double value) throws java.io.IOException
putDouble
in interface BinaryWriteable
java.io.IOException
java.nio.ByteOrder order()
order
in interface BinaryReadable
order
in interface BinaryWriteable
void order(java.nio.ByteOrder order)
order
in interface BinaryReadable
order
in interface BinaryWriteable
order
- new byte ordervoid flush() throws java.io.IOException
flush
in interface BinaryWriteable
java.io.IOException
byte get() throws java.io.IOException
get
in interface BinaryReadable
java.io.IOException
void get(byte[] dst, int offset, int length) throws java.io.IOException
get
in interface BinaryReadable
java.io.IOException
void get(byte[] dst) throws java.io.IOException
get
in interface BinaryReadable
java.io.IOException
void get(java.nio.ByteBuffer buf) throws java.io.IOException
get
in interface BinaryReadable
buf
-
java.io.IOException
void get(java.nio.ByteBuffer buf, int length) throws java.io.IOException
get
in interface BinaryReadable
buf
- length
-
java.io.IOException
short getShort() throws java.io.IOException
getShort
in interface BinaryReadable
java.io.IOException
int getInt() throws java.io.IOException
getInt
in interface BinaryReadable
java.io.IOException
long getLong() throws java.io.IOException
getLong
in interface BinaryReadable
java.io.IOException
float getFloat() throws java.io.IOException
getFloat
in interface BinaryReadable
java.io.IOException
double getDouble() throws java.io.IOException
getDouble
in interface BinaryReadable
java.io.IOException
void removeBytes(long bytes) throws java.io.IOException
bytes
-
java.io.IOException
void insertBytes(long bytes) throws java.io.IOException
bytes
-
java.io.IOException
void setLength(long newLength) throws java.io.IOException
newLength
-
java.io.IOException
long length() throws java.io.IOException
length
in interface BinaryReadable
java.io.IOException
void close() throws java.io.IOException
java.io.IOException
void position(long newPosition) throws java.io.IOException
newPosition
-
java.io.IOException
long position() throws java.io.IOException
position
in interface BinaryReadable
java.io.IOException
void skip(long bytes) throws java.io.IOException
skip
in interface BinaryReadable
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |