Package com.helger.commons.codec
Class IdentityByteArrayCodec
java.lang.Object
com.helger.commons.codec.IdentityCodec<byte[]>
com.helger.commons.codec.IdentityByteArrayCodec
- All Implemented Interfaces:
IByteArrayCodec,IByteArrayDecoder,IByteArrayEncoder,IByteArrayStreamDecoder,IByteArrayStreamEncoder,ICodec<byte[]>,IDecoder<byte[],,byte[]> IEncoder<byte[],byte[]>
Special implementation of
IByteArrayCodec that does nothing. This is
a separate class to be able to identify it from non-identity codecs.- Since:
- 9.1.7
- Author:
- Philip Helger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IdentityByteArrayCodecDefault instance that can be used. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(byte[] aEncodedBuffer, int nOfs, int nLen, OutputStream aOS) Decode (part of) a byte array.voidencode(byte[] aDecodedBuffer, int nOfs, int nLen, OutputStream aOS) Encode (part of) a byte array to anOutputStream.Methods inherited from class com.helger.commons.codec.IdentityCodec
getDecoded, getEncodedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.helger.commons.codec.IByteArrayDecoder
getDecoded, getDecoded, getMaximumDecodedLengthMethods inherited from interface com.helger.commons.codec.IByteArrayStreamDecoder
decode, getDecoded, getDecodedAsString, getDecodedAsString, getDecodedAsString, getDecodedAsStringMethods inherited from interface com.helger.commons.codec.IByteArrayStreamEncoder
encode, getEncoded, getEncoded, getEncoded, getEncodedAsString, getEncodedAsString, getEncodedAsString, getMaximumEncodedLength
-
Field Details
-
INSTANCE
Default instance that can be used.
-
-
Constructor Details
-
IdentityByteArrayCodec
public IdentityByteArrayCodec()
-
-
Method Details
-
decode
public void decode(@Nullable byte[] aEncodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull @WillNotClose OutputStream aOS) Description copied from interface:IByteArrayStreamDecoderDecode (part of) a byte array.- Specified by:
decodein interfaceIByteArrayStreamDecoder- Parameters:
aEncodedBuffer- The byte array to be decoded. May benull.nOfs- Offset into the byte array to start from.nLen- Number of bytes starting from offset to consider.aOS- The output stream to write to. May not benulland is NOT closed afterwards!
-
encode
public void encode(@Nullable byte[] aDecodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull @WillNotClose OutputStream aOS) Description copied from interface:IByteArrayStreamEncoderEncode (part of) a byte array to anOutputStream.- Specified by:
encodein interfaceIByteArrayStreamEncoder- Parameters:
aDecodedBuffer- The byte array to be encoded. May benull.nOfs- Offset into the byte array to start from.nLen- Number of bytes starting from offset to consider.aOS- The output stream to write to. May not benulland is NOT closed afterwards!
-