public class IDatChunkWriter extends Object
Constructor and Description |
---|
IDatChunkWriter(OutputStream outputStream) |
IDatChunkWriter(OutputStream outputStream,
byte[] b) |
IDatChunkWriter(OutputStream outputStream,
int maxChunkLength) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush()
Writes a chhunk if there is more than minLenToWrite.
|
int |
getAvailLen() |
byte[] |
getBuf()
You can write directly to this buffer, using
getOffset() and getAvailLen() . |
protected byte[] |
getChunkId() |
int |
getChunksWriten() |
int |
getOffset() |
long |
getTotalBytesWriten() |
void |
incrementOffset(int n)
triggers an flush+reset if appropiate
|
protected int |
minLenToWrite() |
protected void |
postReset()
this will be called after reset
|
void |
write(byte[] b,
int o,
int len)
this should rarely be used, the normal way (to avoid double copying) is to get the buffer and write directly to it
|
public IDatChunkWriter(OutputStream outputStream)
public IDatChunkWriter(OutputStream outputStream, int maxChunkLength)
public IDatChunkWriter(OutputStream outputStream, byte[] b)
protected byte[] getChunkId()
public final void flush()
public int getOffset()
public int getAvailLen()
public void incrementOffset(int n)
public void write(byte[] b, int o, int len)
protected void postReset()
protected int minLenToWrite()
public void close()
public byte[] getBuf()
getOffset()
and getAvailLen()
. You should call
incrementOffset(int)
inmediately after.public long getTotalBytesWriten()
public int getChunksWriten()
Copyright © 2014. All rights reserved.