public static DataInput wrap(ByteBuffer bb) { return new ByteBufferDataInput(bb); }
public static DataInput wrap(byte[] b) { return wrap(b, 0, b.length); }
@Override public int skipBytes(int n) { int skipped = ranged(n); bb.position(bb.position() + skipped); return skipped; }
private ByteBuffer slice(DataInput in, int length) throws Exception { if (in instanceof ByteBufferDataInput) { ByteBufferDataInput bbin = (ByteBufferDataInput) in; return bbin.slice(length); } byte array[] = new byte[length]; in.readFully(array, 0, length); return ByteBuffer.wrap(array, 0, length); }
private ByteBuffer slice(DataInput in, int length) throws Exception { if (in instanceof ByteBufferDataInput) { ByteBufferDataInput bbin = (ByteBufferDataInput) in; return bbin.slice(length); } byte array[] = new byte[length]; in.readFully(array, 0, length); return ByteBuffer.wrap(array, 0, length); }
public static DataInput wrap(byte[] b) { return wrap(b, 0, b.length); }
@Override public int skipBytes(int n) { int skipped = ranged(n); bb.position(bb.position() + skipped); return skipped; }
public static DataInput wrap(ByteBuffer bb) { return new ByteBufferDataInput(bb); }
public static DataInput wrap(byte[] b) { return wrap(b, 0, b.length); }
@Override public int skipBytes(int n) { int skipped = ranged(n); bb.position(bb.position() + skipped); return skipped; }
public static DataInput wrap(ByteBuffer bb) { return new ByteBufferDataInput(bb); }
public static DataInput wrap(byte[] b) { return wrap(b, 0, b.length); }
@Override public int skipBytes(int n) { int skipped = ranged(n); bb.position(bb.position() + skipped); return skipped; }
public static DataInput wrap(ByteBuffer bb) { return new ByteBufferDataInput(bb); }
public static DataInput wrap(byte[] b) { return wrap(b, 0, b.length); }
@Override public int skipBytes(int n) { int skipped = ranged(n); bb.position(bb.position() + skipped); return skipped; }
public static DataInput wrap(ByteBuffer bb) { return new ByteBufferDataInput(bb); }
public static DataInput wrap(byte[] b) { return wrap(b, 0, b.length); }
@Override public int skipBytes(int n) { int skipped = ranged(n); bb.position(bb.position() + skipped); return skipped; }
public static DataInput wrap(ByteBuffer bb) { return new ByteBufferDataInput(bb); }