public class SegmentWriter extends Object
The same writer is used to create multiple segments (data is automatically split: new segments are automatically created if and when needed).
Constructor and Description |
---|
SegmentWriter(SegmentStore store,
SegmentTracker tracker,
SegmentVersion version) |
Modifier and Type | Method and Description |
---|---|
void |
dropCache() |
void |
flush()
Adds a segment header to the buffer and writes a segment to the segment
store.
|
SegmentTracker |
getTracker() |
SegmentBlob |
writeBlob(Blob blob) |
RecordId |
writeBlock(byte[] bytes,
int offset,
int length)
Writes a block record containing the given block of bytes.
|
RecordId |
writeList(List<RecordId> list)
Writes a list record containing the given list of record identifiers.
|
SegmentNodeState |
writeNode(NodeState state) |
SegmentBlob |
writeStream(InputStream stream)
Writes a stream value record.
|
RecordId |
writeString(String string)
Writes a string value record.
|
RecordId |
writeTemplate(Template template) |
public SegmentWriter(SegmentStore store, SegmentTracker tracker, SegmentVersion version)
public void flush()
public RecordId writeBlock(byte[] bytes, int offset, int length)
bytes
- source bufferoffset
- offset within the source bufferlength
- number of bytes to writepublic RecordId writeList(List<RecordId> list)
list
- list of record identifierspublic RecordId writeString(String string)
string
- string to be writtenpublic SegmentBlob writeBlob(Blob blob) throws IOException
IOException
public void dropCache()
public SegmentBlob writeStream(InputStream stream) throws IOException
stream
- stream to be writtenIOException
- if the stream could not be readpublic SegmentNodeState writeNode(NodeState state)
public SegmentTracker getTracker()
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"