public final class ByteEncoderChannel extends AbstractEncoderChannel implements EncoderChannel
| Modifier and Type | Field and Description |
|---|---|
protected int |
len |
| Constructor and Description |
|---|
ByteEncoderChannel(OutputStream os)
Construct a byte aligned encoder from output stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
align()
Align to next byte-aligned boundary in the stream if it is not already at
such a boundary
|
void |
encode(byte[] b,
int off,
int len) |
void |
encode(int b) |
void |
encodeBoolean(boolean b)
Encode a single boolean value.
|
void |
encodeNBitUnsignedInteger(int b,
int n)
Encode n-bit unsigned integer using the minimum number of bytes required
to store n bits.
|
void |
flush() |
int |
getLength()
Returns the number of bytes written.
|
OutputStream |
getOutputStream() |
encodeBigInteger, encodeBinary, encodeDateTime, encodeDecimal, encodeFloat, encodeInteger, encodeIntegerValue, encodeLong, encodeString, encodeStringOnly, encodeUnsignedBigInteger, encodeUnsignedInteger, encodeUnsignedIntegerValue, encodeUnsignedLongclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitencodeBinary, encodeDateTime, encodeDecimal, encodeFloat, encodeInteger, encodeIntegerValue, encodeString, encodeStringOnly, encodeUnsignedInteger, encodeUnsignedIntegerValuepublic ByteEncoderChannel(OutputStream os)
os - output streampublic OutputStream getOutputStream()
getOutputStream in interface EncoderChannelpublic int getLength()
EncoderChannelgetLength in interface EncoderChannelpublic void flush()
throws IOException
flush in interface EncoderChannelIOExceptionpublic void align()
throws IOException
EncoderChannelalign in interface EncoderChannelIOException - IO exceptionpublic void encode(int b)
throws IOException
encode in interface EncoderChannelIOExceptionpublic void encode(byte[] b,
int off,
int len)
throws IOException
encode in interface EncoderChannelIOExceptionpublic void encodeBoolean(boolean b)
throws IOException,
IllegalArgumentException
encodeBoolean in interface EncoderChannelb - booleanIOException - IO exceptionIllegalArgumentExceptionpublic void encodeNBitUnsignedInteger(int b,
int n)
throws IOException
encodeNBitUnsignedInteger in interface EncoderChannelIOExceptionCopyright © 2018 Siemens AG. All rights reserved.