|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simantics.databoard.util.binary.BinaryMemory
public class BinaryMemory
Rancom access memory blob
Constructor Summary | |
---|---|
BinaryMemory()
New memory blob |
|
BinaryMemory(byte[] data)
New memory blob |
|
BinaryMemory(java.nio.ByteBuffer buf)
Assume an existing byte buffer |
|
BinaryMemory(int initialSize)
New memory blob |
|
BinaryMemory(int initialSize,
int increment)
New memory blob |
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 |
put(java.io.InputStream is)
|
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 |
java.nio.ByteBuffer |
toByteBuffer()
Get the backend byte buffer. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BinaryMemory()
public BinaryMemory(byte[] data)
public BinaryMemory(int initialSize)
public BinaryMemory(int initialSize, int increment)
public BinaryMemory(java.nio.ByteBuffer buf)
buf
- bufferMethod Detail |
---|
public java.nio.ByteBuffer toByteBuffer()
public void close() throws java.io.IOException
RandomAccessBinary
close
in interface RandomAccessBinary
java.io.IOException
public void flush() throws java.io.IOException
RandomAccessBinary
flush
in interface BinaryWriteable
flush
in interface RandomAccessBinary
java.io.IOException
public byte get()
get
in interface BinaryReadable
get
in interface RandomAccessBinary
public void get(byte[] dst, int offset, int length)
get
in interface BinaryReadable
get
in interface RandomAccessBinary
public void get(byte[] dst)
get
in interface BinaryReadable
get
in interface RandomAccessBinary
public void get(java.nio.ByteBuffer buf)
RandomAccessBinary
get
in interface BinaryReadable
get
in interface RandomAccessBinary
public void get(java.nio.ByteBuffer buf, int length)
RandomAccessBinary
get
in interface BinaryReadable
get
in interface RandomAccessBinary
public double getDouble()
getDouble
in interface BinaryReadable
getDouble
in interface RandomAccessBinary
public float getFloat()
getFloat
in interface BinaryReadable
getFloat
in interface RandomAccessBinary
public int getInt()
getInt
in interface BinaryReadable
getInt
in interface RandomAccessBinary
public long getLong()
getLong
in interface BinaryReadable
getLong
in interface RandomAccessBinary
public short getShort()
getShort
in interface BinaryReadable
getShort
in interface RandomAccessBinary
public long length()
RandomAccessBinary
length
in interface BinaryReadable
length
in interface RandomAccessBinary
public long position()
RandomAccessBinary
position
in interface BinaryReadable
position
in interface RandomAccessBinary
public void position(long newPosition) throws java.io.IOException
RandomAccessBinary
position
in interface RandomAccessBinary
java.io.IOException
public java.nio.ByteOrder order()
RandomAccessBinary
order
in interface BinaryReadable
order
in interface BinaryWriteable
order
in interface RandomAccessBinary
public void order(java.nio.ByteOrder order)
RandomAccessBinary
order
in interface BinaryReadable
order
in interface BinaryWriteable
order
in interface RandomAccessBinary
order
- new byte orderpublic void put(byte b) throws java.io.IOException
RandomAccessBinary
put
in interface BinaryWriteable
put
in interface RandomAccessBinary
java.io.IOException
public void put(java.nio.ByteBuffer src) throws java.io.IOException
RandomAccessBinary
put
in interface BinaryWriteable
put
in interface RandomAccessBinary
java.io.IOException
public void put(java.nio.ByteBuffer src, int length) throws java.io.IOException
RandomAccessBinary
put
in interface BinaryWriteable
put
in interface RandomAccessBinary
java.io.IOException
public void put(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public void put(byte[] src, int offset, int length) throws java.io.IOException
put
in interface BinaryWriteable
put
in interface RandomAccessBinary
java.io.IOException
public void put(byte[] src) throws java.io.IOException
put
in interface BinaryWriteable
put
in interface RandomAccessBinary
java.io.IOException
public void putDouble(double value) throws java.io.IOException
putDouble
in interface BinaryWriteable
putDouble
in interface RandomAccessBinary
java.io.IOException
public void putFloat(float value) throws java.io.IOException
putFloat
in interface BinaryWriteable
putFloat
in interface RandomAccessBinary
java.io.IOException
public void putInt(int value) throws java.io.IOException
putInt
in interface BinaryWriteable
putInt
in interface RandomAccessBinary
java.io.IOException
public void putLong(long value) throws java.io.IOException
putLong
in interface BinaryWriteable
putLong
in interface RandomAccessBinary
java.io.IOException
public void putShort(short value) throws java.io.IOException
putShort
in interface BinaryWriteable
putShort
in interface RandomAccessBinary
java.io.IOException
public void insertBytes(long bytes) throws java.io.IOException
RandomAccessBinary
insertBytes
in interface RandomAccessBinary
java.io.IOException
public void removeBytes(long bytes) throws java.io.IOException
RandomAccessBinary
removeBytes
in interface RandomAccessBinary
java.io.IOException
public void setLength(long newLength) throws java.io.IOException
RandomAccessBinary
setLength
in interface RandomAccessBinary
java.io.IOException
public void skip(long bytes) throws java.io.IOException
RandomAccessBinary
skip
in interface BinaryReadable
skip
in interface RandomAccessBinary
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |