|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simantics.databoard.util.binary.Blob
public class Blob
Blob is recursive random access binary. Blob is isolated random access binary, modifications, insertions and removals of bytes outside the represented bytes do not affect the blob. Insertions and removals of bytes to the parent do affect the blob, its start index, length and pointer are changed.
A backend must not be wrapped in a blob more than once.
Grow, Shrink, Insertion, and Removal affects child blobs if affected region intersects with a child. Grow, Shrink, Insertion, and Removal affects parent. It updates parent length, and start positions of the following (not preceding) siblings.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.simantics.databoard.util.binary.RandomAccessBinary |
---|
RandomAccessBinary.ByteSide |
Constructor Summary | |
---|---|
Blob(RandomAccessBinary parent)
Create a sub-blob to a random access binary. |
|
Blob(RandomAccessBinary parent,
long start,
long length)
Create a sub-blob to a random access binary. |
Method Summary | |
---|---|
void |
close()
Flush and close the blob. |
Blob |
createSubBlob(long start,
long length)
|
void |
flush()
Flush write buffer |
RandomAccessBinary |
getParent()
|
RandomAccessBinary |
getSource()
|
long |
getStartPositionInSourceBinary()
|
void |
insertBytes(long bytes,
RandomAccessBinary.ByteSide side)
Insert bytes at current pointer. |
boolean |
isOpen()
Check if binary is open. |
long |
length()
Get the length of the binary object. |
long |
position()
Get the position of the cursor |
void |
position(long newPosition)
Set new cursor position. |
boolean |
readBoolean()
|
byte |
readByte()
|
char |
readChar()
|
double |
readDouble()
|
float |
readFloat()
|
void |
readFully(byte[] dst)
|
void |
readFully(byte[] dst,
int offset,
int length)
|
void |
readFully(java.nio.ByteBuffer buf)
Read buf fully |
void |
readFully(java.nio.ByteBuffer buf,
int length)
Read fully length bytes |
int |
readInt()
|
java.lang.String |
readLine()
|
long |
readLong()
|
short |
readShort()
|
int |
readUnsignedByte()
|
int |
readUnsignedShort()
|
java.lang.String |
readUTF()
|
void |
removeBytes(long bytes,
RandomAccessBinary.ByteSide side)
Remove bytes at pointer. |
void |
reset()
Reset internal cache. |
void |
setLength(long newLength)
Modify the size of the blob. |
void |
setPositionInSource(long start,
long length)
|
int |
skipBytes(int bytes)
|
long |
skipBytes(long bytes)
|
java.lang.String |
toString()
|
void |
write(byte[] src)
|
void |
write(byte[] src,
int offset,
int length)
|
void |
write(int b)
|
void |
writeBoolean(boolean v)
|
void |
writeByte(int b)
|
void |
writeBytes(java.lang.String s)
|
void |
writeChar(int value)
|
void |
writeChars(java.lang.String s)
|
void |
writeDouble(double value)
|
void |
writeFloat(float value)
|
void |
writeFully(java.nio.ByteBuffer src)
Put n bytes from the remaining of the byte array. |
void |
writeFully(java.nio.ByteBuffer src,
int length)
Put n bytes from the remaining of the byte buffer. |
void |
writeInt(int value)
|
void |
writeLong(long value)
|
void |
writeShort(int value)
|
void |
writeUTF(java.lang.String s)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Blob(RandomAccessBinary parent) throws java.io.IOException
parent
-
java.io.IOException
public Blob(RandomAccessBinary parent, long start, long length)
parent
- start
- length
- Method Detail |
---|
public Blob createSubBlob(long start, long length)
public RandomAccessBinary getParent()
public void close() throws java.io.IOException
RandomAccessBinary
close
in interface RandomAccessBinary
java.io.IOException
public boolean isOpen()
RandomAccessBinary
isOpen
in interface RandomAccessBinary
public void insertBytes(long bytes, RandomAccessBinary.ByteSide side) throws java.io.IOException
RandomAccessBinary
insertBytes
in interface RandomAccessBinary
java.io.IOException
public void removeBytes(long bytes, RandomAccessBinary.ByteSide side) throws java.io.IOException
removeBytes
in interface RandomAccessBinary
bytes
-
java.io.IOException
public void setLength(long newLength) throws java.io.IOException
setLength
in interface RandomAccessBinary
newLength
- new number of bytes
java.io.IOException
public RandomAccessBinary getSource()
public void flush() throws java.io.IOException
RandomAccessBinary
flush
in interface BinaryWriteable
flush
in interface RandomAccessBinary
java.io.IOException
public void reset() throws java.io.IOException
RandomAccessBinary
reset
in interface RandomAccessBinary
java.io.IOException
public void write(int b) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
public void writeByte(int b) throws java.io.IOException
writeByte
in interface java.io.DataOutput
java.io.IOException
public void writeBoolean(boolean v) throws java.io.IOException
writeBoolean
in interface java.io.DataOutput
java.io.IOException
public void writeFully(java.nio.ByteBuffer src) throws java.io.IOException
BinaryWriteable
writeFully
in interface BinaryWriteable
java.io.IOException
public void writeFully(java.nio.ByteBuffer src, int length) throws java.io.IOException
BinaryWriteable
writeFully
in interface BinaryWriteable
java.io.IOException
public void write(byte[] src, int offset, int length) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
public void write(byte[] src) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
public void writeDouble(double value) throws java.io.IOException
writeDouble
in interface java.io.DataOutput
java.io.IOException
public void writeFloat(float value) throws java.io.IOException
writeFloat
in interface java.io.DataOutput
java.io.IOException
public void writeInt(int value) throws java.io.IOException
writeInt
in interface java.io.DataOutput
java.io.IOException
public void writeLong(long value) throws java.io.IOException
writeLong
in interface java.io.DataOutput
java.io.IOException
public void writeShort(int value) throws java.io.IOException
writeShort
in interface java.io.DataOutput
java.io.IOException
public void writeChar(int value) throws java.io.IOException
writeChar
in interface java.io.DataOutput
java.io.IOException
public void writeBytes(java.lang.String s) throws java.io.IOException
writeBytes
in interface java.io.DataOutput
java.io.IOException
public void writeChars(java.lang.String s) throws java.io.IOException
writeChars
in interface java.io.DataOutput
java.io.IOException
public void writeUTF(java.lang.String s) throws java.io.IOException
writeUTF
in interface java.io.DataOutput
java.io.IOException
public byte readByte() throws java.io.IOException
readByte
in interface java.io.DataInput
java.io.IOException
public int readUnsignedByte() throws java.io.IOException
readUnsignedByte
in interface java.io.DataInput
java.io.IOException
public boolean readBoolean() throws java.io.IOException
readBoolean
in interface java.io.DataInput
java.io.IOException
public void readFully(byte[] dst, int offset, int length) throws java.io.IOException
readFully
in interface java.io.DataInput
java.io.IOException
public void readFully(byte[] dst) throws java.io.IOException
readFully
in interface java.io.DataInput
java.io.IOException
public void readFully(java.nio.ByteBuffer buf) throws java.io.IOException
BinaryReadable
readFully
in interface BinaryReadable
java.io.IOException
public void readFully(java.nio.ByteBuffer buf, int length) throws java.io.IOException
BinaryReadable
readFully
in interface BinaryReadable
java.io.IOException
public double readDouble() throws java.io.IOException
readDouble
in interface java.io.DataInput
java.io.IOException
public float readFloat() throws java.io.IOException
readFloat
in interface java.io.DataInput
java.io.IOException
public int readInt() throws java.io.IOException
readInt
in interface java.io.DataInput
java.io.IOException
public long readLong() throws java.io.IOException
readLong
in interface java.io.DataInput
java.io.IOException
public short readShort() throws java.io.IOException
readShort
in interface java.io.DataInput
java.io.IOException
public java.lang.String readLine() throws java.io.IOException
readLine
in interface java.io.DataInput
java.io.IOException
public final java.lang.String readUTF() throws java.io.IOException
readUTF
in interface java.io.DataInput
java.io.IOException
public char readChar() throws java.io.IOException
readChar
in interface java.io.DataInput
java.io.IOException
public int readUnsignedShort() throws java.io.IOException
readUnsignedShort
in interface java.io.DataInput
java.io.IOException
public long length() throws java.io.IOException
RandomAccessBinary
length
in interface BinaryReadable
length
in interface RandomAccessBinary
java.io.IOException
public long position() throws java.io.IOException
RandomAccessBinary
position
in interface BinaryReadable
position
in interface RandomAccessBinary
java.io.IOException
public void position(long newPosition) throws java.io.IOException
RandomAccessBinary
position
in interface RandomAccessBinary
java.io.IOException
public long skipBytes(long bytes) throws java.io.IOException
skipBytes
in interface BinaryReadable
java.io.IOException
public int skipBytes(int bytes) throws java.io.IOException
skipBytes
in interface java.io.DataInput
java.io.IOException
public long getStartPositionInSourceBinary()
public java.lang.String toString()
toString
in class java.lang.Object
public void setPositionInSource(long start, long length)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |