text: public void writeBytes(byte[] b, int offset, int length) {assert b.length >= offset + length;if (length == 0) {return;}if (upto == blockSize) {if (currentBlock != null) {addBlock(currentBlock);}currentBlock = new byte[blockSize];upto = 0;}final int offsetEnd = offset + length;while(true) {final int left = offsetEnd - offset;final int blockLeft = blockSize - upto;if (blockLeft < left) {System.arraycopy(b, offset, currentBlock, upto, blockLeft);addBlock(currentBlock);currentBlock = new byte[blockSize];upto = 0;offset += blockLeft;} else {System.arraycopy(b, offset, currentBlock, upto, left);upto += left;break;}}}