@Override public void writeZero(int length) { checkArgument(length >= 0, "length must be greater than or equal to 0"); while (length > 0) { int batch = tryEnsureBatchSize(length); Arrays.fill(buffer, bufferPosition, bufferPosition + batch, (byte) 0); bufferPosition += batch; length -= batch; } }
@Override public void writeZero(int length) { checkArgument(length >= 0, "length must be greater than or equal to 0"); while (length > 0) { int batch = tryEnsureBatchSize(length); Arrays.fill(buffer, bufferPosition, bufferPosition + batch, (byte) 0); bufferPosition += batch; length -= batch; } }
@Override public void writeBytes(InputStream in, int length) throws IOException { while (length > 0) { int batch = tryEnsureBatchSize(length); slice.setBytes(bufferPosition, in, batch); bufferPosition += batch; length -= batch; } }
@Override public void writeBytes(InputStream in, int length) throws IOException { while (length > 0) { int batch = tryEnsureBatchSize(length); slice.setBytes(bufferPosition, in, batch); bufferPosition += batch; length -= batch; } }
@Override public void writeBytes(byte[] source, int sourceIndex, int length) { while (length > 0) { int batch = tryEnsureBatchSize(length); slice.setBytes(bufferPosition, source, sourceIndex, batch); bufferPosition += batch; sourceIndex += batch; length -= batch; } }
@Override public void writeBytes(Slice source, int sourceIndex, int length) { while (length > 0) { int batch = tryEnsureBatchSize(length); slice.setBytes(bufferPosition, source, sourceIndex, batch); bufferPosition += batch; sourceIndex += batch; length -= batch; } }
@Override public void writeBytes(byte[] source, int sourceIndex, int length) { while (length > 0) { int batch = tryEnsureBatchSize(length); slice.setBytes(bufferPosition, source, sourceIndex, batch); bufferPosition += batch; sourceIndex += batch; length -= batch; } }
@Override public void writeBytes(Slice source, int sourceIndex, int length) { while (length > 0) { int batch = tryEnsureBatchSize(length); slice.setBytes(bufferPosition, source, sourceIndex, batch); bufferPosition += batch; sourceIndex += batch; length -= batch; } }