@Override public long skip(long n) throws IOException { long counter = n; while(counter > Integer.MAX_VALUE) { int skippedBytes = inputView.skipBytes(Integer.MAX_VALUE); if (skippedBytes == 0) { return n - counter; } counter -= skippedBytes; } return n - counter - inputView.skipBytes((int) counter); }
@Override public long skip(long n) throws IOException { long counter = n; while(counter > Integer.MAX_VALUE) { int skippedBytes = inputView.skipBytes(Integer.MAX_VALUE); if (skippedBytes == 0) { return n - counter; } counter -= skippedBytes; } return n - counter - inputView.skipBytes((int) counter); }
@Override public long skip(long n) throws IOException { long counter = n; while(counter > Integer.MAX_VALUE) { int skippedBytes = inputView.skipBytes(Integer.MAX_VALUE); if (skippedBytes == 0) { return n - counter; } counter -= skippedBytes; } return n - counter - inputView.skipBytes((int) counter); }
/** * Decode a bigint value. */ public BigInteger decodeBigInteger(DataInputView source, Order ord) throws IOException { // skip the first 4 bytes which is only used for sort source.skipBytes(4); if (reuseBuffer == null) { reuseBuffer = new byte[BUFFER_SIZE]; } if (reuseBaos == null) { reuseBaos = new ByteArrayOutputStreamWithPos(); } reuseBaos.reset(); int len; while ((len = source.read(reuseBuffer)) != -1) { reuseBaos.write(reuseBuffer, 0, len); } return new BigInteger(ord.apply(reuseBaos.toByteArray())); }