Class VarBinaryChunkWriter.ByteStorage
java.lang.Object
java.io.OutputStream
io.deephaven.extensions.barrage.chunk.VarBinaryChunkWriter.ByteStorage
- All Implemented Interfaces:
SafeCloseable,Closeable,Flushable,AutoCloseable
- Enclosing class:
- VarBinaryChunkWriter<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longgetPayloadSize(int sPos, int ePos) computes the size of the payload from sPos to ePos (inclusive)booleanisEmpty()longsize()voidwrite(@org.jetbrains.annotations.NotNull byte[] b, int off, int len) Writeslenbytes from the specified byte array starting at offsetoffto the underlyingByteChunk.voidwrite(int b) Writes the specified byte to the underlyingByteChunk.longwritePayload(com.google.common.io.LittleEndianDataOutputStream dos, int sPos, int ePos) write payload from sPos to ePos (inclusive) to the output streamMethods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
Constructor Details
-
ByteStorage
public ByteStorage(int size)
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
write
Writes the specified byte to the underlyingByteChunk.- Specified by:
writein classOutputStream- Parameters:
b- the byte to be written.- Throws:
IOException
-
write
public void write(@NotNull @org.jetbrains.annotations.NotNull byte[] b, int off, int len) throws IOException Writeslenbytes from the specified byte array starting at offsetoffto the underlyingByteChunk.- Overrides:
writein classOutputStream- Parameters:
b- the data.off- the start offset in the data.len- the number of bytes to write.- Throws:
IndexOutOfBoundsException- ifoffis negative,lenis negative, orlenis greater thanb.length - offIOException
-
size
public long size() -
getPayloadSize
public long getPayloadSize(int sPos, int ePos) computes the size of the payload from sPos to ePos (inclusive)- Parameters:
sPos- the first data item to include in this payloadePos- the last data item to include in this payload- Returns:
- number of bytes in the payload
-
writePayload
public long writePayload(com.google.common.io.LittleEndianDataOutputStream dos, int sPos, int ePos) throws IOException write payload from sPos to ePos (inclusive) to the output stream- Parameters:
dos- the data output stream to populate with datasPos- the first data item to include in this payloadePos- the last data item to include in this payload- Returns:
- number of bytes written to the outputstream
- Throws:
IOException- if there is a problem writing to the output stream
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSafeCloseable- Overrides:
closein classOutputStream
-