class SilentByteBufferStream extends OutputStream
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
mBuffer |
private long |
mMarker |
private long |
mNumValidBytes |
private boolean |
mOverflow |
| Constructor and Description |
|---|
SilentByteBufferStream()
Constructor - uses default value of buffer capacity (20KiB)
|
SilentByteBufferStream(long capacity)
Constructor - uses specified buffer capacity
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
byte[] |
getBuffer()
Get byte buffer for this stream
|
long |
getMarker()
Get marker value
|
long |
getNumValidBytes()
Get number of valid bytes
|
boolean |
overflow()
Returns if the buffer has overflowed
|
void |
resize(long newSize)
Resizes buffer to new size - data is retained
|
void |
setMarker(long value)
Caller code can use this function to mark a certain point in the buffer
This is generally used to mark the position in the buffer after the last
complete VariantContext object written
|
void |
setNumValidBytes(long value)
Set number of valid bytes
|
void |
setOverflow(boolean value)
Set overflow value
|
int |
size()
Returns buffer capacity in bytes
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
private byte[] mBuffer
private long mNumValidBytes
private long mMarker
private boolean mOverflow
public SilentByteBufferStream()
public SilentByteBufferStream(long capacity)
capacity - size of buffer in bytespublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic int size()
public void resize(long newSize)
newSize - new capacity of the bufferpublic boolean overflow()
public void setOverflow(boolean value)
value - overflow valuepublic long getNumValidBytes()
public void setNumValidBytes(long value)
value - number of valid bytespublic void setMarker(long value)
value - set marker valuepublic long getMarker()
public byte[] getBuffer()
Copyright © 2017. All rights reserved.