@Override public void skipBytesToWrite(int numBytes) throws IOException { if (tempBuffer == null) { tempBuffer = new byte[4096]; } while (numBytes > 0) { int toWrite = Math.min(numBytes, tempBuffer.length); write(tempBuffer, 0, toWrite); numBytes -= toWrite; } }
@Override public void write(DataInputView source, int numBytes) throws IOException { if (tempBuffer == null) { tempBuffer = new byte[4096]; } while (numBytes > 0) { int toCopy = Math.min(numBytes, tempBuffer.length); source.readFully(tempBuffer, 0, toCopy); write(tempBuffer, 0, toCopy); numBytes -= toCopy; } } }
@Override public void skipBytesToWrite(int numBytes) throws IOException { if (tempBuffer == null) { tempBuffer = new byte[4096]; } while (numBytes > 0) { int toWrite = Math.min(numBytes, tempBuffer.length); write(tempBuffer, 0, toWrite); numBytes -= toWrite; } }
@Override public void skipBytesToWrite(int numBytes) throws IOException { if (tempBuffer == null) { tempBuffer = new byte[4096]; } while (numBytes > 0) { int toWrite = Math.min(numBytes, tempBuffer.length); write(tempBuffer, 0, toWrite); numBytes -= toWrite; } }
@Override public void write(DataInputView source, int numBytes) throws IOException { if (tempBuffer == null) { tempBuffer = new byte[4096]; } while (numBytes > 0) { int toCopy = Math.min(numBytes, tempBuffer.length); source.readFully(tempBuffer, 0, toCopy); write(tempBuffer, 0, toCopy); numBytes -= toCopy; } }
@Override public void write(DataInputView source, int numBytes) throws IOException { if (tempBuffer == null) { tempBuffer = new byte[4096]; } while (numBytes > 0) { int toCopy = Math.min(numBytes, tempBuffer.length); source.readFully(tempBuffer, 0, toCopy); write(tempBuffer, 0, toCopy); numBytes -= toCopy; } } }
@Override public void write(MemorySegment segment, int off, int len) throws IOException { if (out instanceof MemorySegmentWritable) { ((MemorySegmentWritable) out).write(segment, off, len); } else { if (tempBuffer == null) { tempBuffer = new byte[4096]; } int remain = len; while (remain > 0) { int toCopy = Math.min(remain, tempBuffer.length); segment.get(len - remain + off, tempBuffer, 0, toCopy); write(tempBuffer, 0, toCopy); remain -= toCopy; } } } }