private void flushBufferToOutputStream() { writeToOutputStream(buffer, 0, bufferPosition); bufferOffset += bufferPosition; bufferPosition = 0; }
private void flushBufferToOutputStream() { writeToOutputStream(buffer, 0, bufferPosition); bufferOffset += bufferPosition; bufferPosition = 0; }
@Override public void writeBytes(Slice source, int sourceIndex, int length) { // Write huge chunks direct to OutputStream if (length >= MINIMUM_CHUNK_SIZE) { flushBufferToOutputStream(); writeToOutputStream(source, sourceIndex, length); bufferOffset += length; } else { ensureWritableBytes(length); slice.setBytes(bufferPosition, source, sourceIndex, length); bufferPosition += length; } }
@Override public void writeBytes(byte[] source, int sourceIndex, int length) { // Write huge chunks direct to OutputStream if (length >= MINIMUM_CHUNK_SIZE) { flushBufferToOutputStream(); writeToOutputStream(source, sourceIndex, length); bufferOffset += length; } else { ensureWritableBytes(length); slice.setBytes(bufferPosition, source, sourceIndex, length); bufferPosition += length; } }
@Override public void writeBytes(Slice source, int sourceIndex, int length) { // Write huge chunks direct to OutputStream if (length >= MINIMUM_CHUNK_SIZE) { flushBufferToOutputStream(); writeToOutputStream(source, sourceIndex, length); bufferOffset += length; } else { ensureWritableBytes(length); slice.setBytes(bufferPosition, source, sourceIndex, length); bufferPosition += length; } }
@Override public void writeBytes(byte[] source, int sourceIndex, int length) { // Write huge chunks direct to OutputStream if (length >= MINIMUM_CHUNK_SIZE) { flushBufferToOutputStream(); writeToOutputStream(source, sourceIndex, length); bufferOffset += length; } else { ensureWritableBytes(length); slice.setBytes(bufferPosition, source, sourceIndex, length); bufferPosition += length; } }