|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simantics.databoard.util.binary.FileWriteable
public class FileWriteable
This class is a Random Access File implementation to BinaryWritable
implementation. The implementation is buffered, therefore the values
may not be written until flush()
. The implementation is not
multi-thread safe. Although file pointer of the backend RandomAccessFile
is allowed to move between read operations of this class.
Constructor Summary | |
---|---|
FileWriteable(java.io.RandomAccessFile file)
Create a BinaryWritable implemantation wrapped over a RandomAccessFile. |
Method Summary | |
---|---|
void |
close()
|
void |
flush()
Flush write buffer |
java.io.RandomAccessFile |
getFile()
|
java.nio.ByteOrder |
order()
|
void |
order(java.nio.ByteOrder order)
|
long |
position()
Get position |
void |
position(long newPosition)
Seek new 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)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileWriteable(java.io.RandomAccessFile file) throws java.io.IOException
file
-
java.io.IOException
Method Detail |
---|
public void close() throws java.io.IOException
java.io.IOException
public java.io.RandomAccessFile getFile()
public java.nio.ByteOrder order()
order
in interface BinaryWriteable
public void order(java.nio.ByteOrder order)
order
in interface BinaryWriteable
public void put(byte b) throws java.io.IOException
BinaryWriteable
put
in interface BinaryWriteable
java.io.IOException
public void put(java.nio.ByteBuffer src) throws java.io.IOException
BinaryWriteable
put
in interface BinaryWriteable
java.io.IOException
public void put(java.nio.ByteBuffer src, int length) throws java.io.IOException
BinaryWriteable
put
in interface BinaryWriteable
java.io.IOException
public void put(byte[] src, int offset, int length) throws java.io.IOException
put
in interface BinaryWriteable
java.io.IOException
public void put(byte[] src) throws java.io.IOException
put
in interface BinaryWriteable
java.io.IOException
public void putDouble(double value) throws java.io.IOException
putDouble
in interface BinaryWriteable
java.io.IOException
public void putFloat(float value) throws java.io.IOException
putFloat
in interface BinaryWriteable
java.io.IOException
public void putInt(int value) throws java.io.IOException
putInt
in interface BinaryWriteable
java.io.IOException
public void putLong(long value) throws java.io.IOException
putLong
in interface BinaryWriteable
java.io.IOException
public void putShort(short value) throws java.io.IOException
putShort
in interface BinaryWriteable
java.io.IOException
public void flush() throws java.io.IOException
BinaryWriteable
flush
in interface BinaryWriteable
java.io.IOException
public long position()
Seekable
position
in interface Seekable
public void position(long newPosition) throws java.io.IOException
Seekable
position
in interface Seekable
newPosition
- new position
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |