@groovy.transform.CompileStatic class SequentialFileStore extends java.lang.Object
A buffered storage. When data written is greater than the local buffer teh content is save to a file.
Usage idiom:
def store = new SequentialFileStore(temp_file)
store.writeInt(x)
store.writeLong(y)
:
store.flip()
int x = store.readInt()
long y = store.readLong()
:
store.close()
Constructor and description |
---|
SequentialFileStore
(java.nio.file.Path path, int size = 0) |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
close() |
|
void |
flip() Turn the buffer in read mode |
|
boolean |
readBool() |
|
byte |
readByte() |
|
void |
readBytes(byte[] bytes) |
|
byte[] |
readBytes(int len) |
|
char |
readChar() |
|
int |
readInt() |
|
long |
readLong() |
|
short |
readShort() |
|
long |
size() |
|
SequentialFileStore |
writeBool(boolean value) |
|
SequentialFileStore |
writeByte(byte value) |
|
SequentialFileStore |
writeBytes(byte[] bytes) |
|
SequentialFileStore |
writeChar(char value) |
|
SequentialFileStore |
writeInt(int v) |
|
SequentialFileStore |
writeLong(long v) |
|
SequentialFileStore |
writeShort(short value) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Turn the buffer in read mode