public abstract class AbstractEncoder<T> extends Object implements Encoder<T>
Encoder
that implements
all of Encoder's methods validating the input, but has those methods defer logic to to a new
method, decodeUnchecked(byte[], int, int)
.Constructor and Description |
---|
AbstractEncoder() |
Modifier and Type | Method and Description |
---|---|
T |
decode(byte[] b) |
T |
decode(byte[] b,
int offset,
int len)
Checks if the byte array is null, or if parameters exceed the bounds of the byte array, then
calls
decodeUnchecked(byte[], int, int) . |
protected abstract T |
decodeUnchecked(byte[] b,
int offset,
int len)
Decodes a byte array without checking if the offset and len exceed the bounds of the actual
array.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
encode
protected abstract T decodeUnchecked(byte[] b, int offset, int len) throws ValueFormatException
ValueFormatException
public T decode(byte[] b)
decode
in interface TypedValueCombiner.Encoder<T>
public T decode(byte[] b, int offset, int len)
decodeUnchecked(byte[], int, int)
.NullPointerException
- if b
is nullIllegalArgumentException
- if offset + len
exceeds the length of b
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.