src/main/java/org/nustaq/serialization/simpleapi/OnHeapCoder.java
@Override
    public Object toObject( byte arr[], int startIndex, int availableSize) {
        try {
            in.resetForReuse(null);
            readTarget.setBase(arr,startIndex,availableSize);
            Object o = in.readObject();
            return o;
        } catch (Exception e) {
            FSTUtil.<RuntimeException>rethrow(e);
        }
        return null;
    }
@Override
    public Object toObject( byte arr[], int startIndex, int availableSize) {
        try {
            in.resetForReuse(null);
            readTarget.setBase(arr,startIndex,availableSize);
            Object o = in.readObject();
            return o;
        } catch (Exception e) {
            FSTUtil.<RuntimeException>rethrow(e);
        }
        return null;
    }
throws FSTBufferTooSmallExcpetion in case object does not fit into given range

@param arr
@param startIndex
@param availableSize
@return
@throws Exception