@Override protected Input getInput(InputStream is) { return new UnsafeInput(is); }
/** {@inheritDoc} */ final public int[] readInts (int length) throws KryoException { int bytesToCopy = length << 2; int[] array = new int[length]; readBytes(array, intArrayBaseOffset, 0, bytesToCopy); return array; }
/** Reads an 8 byte long. */ public long readLong () throws KryoException { require(8); long result = unsafe().getLong(buffer, byteArrayBaseOffset + position); position += 8; return result; }
public int readInt (boolean optimizePositive) throws KryoException { if (!varIntsEnabled) return readInt(); else return super.readInt(optimizePositive); }
public long readLong (boolean optimizePositive) throws KryoException { if (!varIntsEnabled) return readLong(); else return super.readLong(optimizePositive); }
/** Reads a 2 byte short. */ public short readShort () throws KryoException { require(2); short result = unsafe().getShort(buffer, byteArrayBaseOffset + position); position += 2; return result; }
public int readInt (boolean optimizePositive) throws KryoException { if (!varIntsEnabled) return readInt(); else return super.readInt(optimizePositive); }
public long readLong (boolean optimizePositive) throws KryoException { if (!varIntsEnabled) return readLong(); else return super.readLong(optimizePositive); }
@Override public Input getInput (int bufferSize) { return (isUnsafe) ? new UnsafeInput(bufferSize) : new Input(bufferSize); }
/** {@inheritDoc} */ final public float[] readFloats (int length) throws KryoException { int bytesToCopy = length << 2; float[] array = new float[length]; readBytes(array, floatArrayBaseOffset, 0, bytesToCopy); return array; }
/** Reads an 8 byte long. */ public long readLong () throws KryoException { require(8); long result = unsafe().getLong(buffer, byteArrayBaseOffset + position); position += 8; return result; }
public int readInt (boolean optimizePositive) throws KryoException { if (!varIntsEnabled) return readInt(); else return super.readInt(optimizePositive); }
public long readLong (boolean optimizePositive) throws KryoException { if (!varIntsEnabled) return readLong(); else return super.readLong(optimizePositive); }
@Override public Input getInput(byte[] buffer, int offset, int count) { return (isUnsafe)? new UnsafeInput(buffer, offset, count) : new Input(buffer, offset, count); }
/** {@inheritDoc} */ final public long[] readLongs (int length) throws KryoException { int bytesToCopy = length << 3; long[] array = new long[length]; readBytes(array, longArrayBaseOffset, 0, bytesToCopy); return array; }
/** Reads a 4 byte int. */ public int readInt () throws KryoException { require(4); int result = unsafe().getInt(buffer, byteArrayBaseOffset + position); position += 4; return result; }
public int readInt (boolean optimizePositive) throws KryoException { if (!varIntsEnabled) return readInt(); else return super.readInt(optimizePositive); }
public long readLong (boolean optimizePositive) throws KryoException { if (!varIntsEnabled) return readLong(); else return super.readLong(optimizePositive); }
@Override public Input getInput (InputStream inputStream, int bufferSize) { return (isUnsafe) ? new UnsafeInput(inputStream, bufferSize) : new Input(inputStream, bufferSize); }
/** {@inheritDoc} */ final public double[] readDoubles (int length) throws KryoException { int bytesToCopy = length << 3; double[] array = new double[length]; readBytes(array, doubleArrayBaseOffset, 0, bytesToCopy); return array; }