private ByteBuffer newCopyBuffer(PackOutputStream out, ReadableChannel rc) { int bs = blockSize(rc); byte[] copyBuf = out.getCopyBuffer(); if (bs > copyBuf.length) copyBuf = new byte[bs]; return ByteBuffer.wrap(copyBuf, 0, bs); }
@Override void write(PackOutputStream out, long pos, int cnt) throws IOException { final ByteBuffer s = buffer.slice(); s.position((int) (pos - start)); while (0 < cnt) { byte[] buf = out.getCopyBuffer(); int n = Math.min(cnt, buf.length); s.get(buf, 0, n); out.write(buf, 0, n); cnt -= n; } }
final CRC32 crc1 = validate ? new CRC32() : null; final CRC32 crc2 = validate ? new CRC32() : null; final byte[] buf = out.getCopyBuffer();
final CRC32 crc1 = validate ? new CRC32() : null; final CRC32 crc2 = validate ? new CRC32() : null; final byte[] buf = out.getCopyBuffer();
private ByteBuffer newCopyBuffer(PackOutputStream out, ReadableChannel rc) { int bs = blockSize(rc); byte[] copyBuf = out.getCopyBuffer(); if (bs > copyBuf.length) copyBuf = new byte[bs]; return ByteBuffer.wrap(copyBuf, 0, bs); }
private ByteBuffer newCopyBuffer(PackOutputStream out, ReadableChannel rc) { int bs = blockSize(rc); byte[] copyBuf = out.getCopyBuffer(); if (bs > copyBuf.length) copyBuf = new byte[bs]; return ByteBuffer.wrap(copyBuf, 0, bs); }
@Override void write(PackOutputStream out, long pos, int cnt) throws IOException { final ByteBuffer s = buffer.slice(); s.position((int) (pos - start)); while (0 < cnt) { byte[] buf = out.getCopyBuffer(); int n = Math.min(cnt, buf.length); s.get(buf, 0, n); out.write(buf, 0, n); cnt -= n; } }
@Override void write(PackOutputStream out, long pos, int cnt) throws IOException { final ByteBuffer s = buffer.slice(); s.position((int) (pos - start)); while (0 < cnt) { byte[] buf = out.getCopyBuffer(); int n = Math.min(cnt, buf.length); s.get(buf, 0, n); out.write(buf, 0, n); cnt -= n; } }
final CRC32 crc1 = validate ? new CRC32() : null; final CRC32 crc2 = validate ? new CRC32() : null; final byte[] buf = out.getCopyBuffer();
final CRC32 crc1 = validate ? new CRC32() : null; final CRC32 crc2 = validate ? new CRC32() : null; final byte[] buf = out.getCopyBuffer();
final CRC32 crc1 = validate ? new CRC32() : null; final CRC32 crc2 = validate ? new CRC32() : null; final byte[] buf = out.getCopyBuffer();
final CRC32 crc1 = validate ? new CRC32() : null; final CRC32 crc2 = validate ? new CRC32() : null; final byte[] buf = out.getCopyBuffer();