@Override public void writeByte(byte b) throws IOException { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } if (crc != null) { crc.update(b); } currentBuffer[bufferPosition++] = b; }
@Override public void writeBytes(byte[] b, int offset, int len) throws IOException { assert b != null; if (crc != null) { crc.update(b, offset, len); } while (len > 0) { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } int remainInBuffer = currentBuffer.length - bufferPosition; int bytesToCopy = len < remainInBuffer ? len : remainInBuffer; System.arraycopy(b, offset, currentBuffer, bufferPosition, bytesToCopy); offset += bytesToCopy; len -= bytesToCopy; bufferPosition += bytesToCopy; } }
public void writeByte(byte b) throws IOException { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } currentBuffer[bufferPosition++] = b; }
public void writeByte(byte b) throws IOException { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } currentBuffer[bufferPosition++] = b; }
@Override public void writeByte(byte b) throws IOException { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } currentBuffer[bufferPosition++] = b; }
@Override public void writeByte(byte b) throws IOException { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } if (crc != null) { crc.update(b); } currentBuffer[bufferPosition++] = b; }
@Override public void writeByte(byte b) throws IOException { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } if (crc != null) { crc.update(b); } currentBuffer[bufferPosition++] = b; }
@Override public void writeByte(byte b) throws IOException { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } if (crc != null) { crc.update(b); } currentBuffer[bufferPosition++] = b; }
public void writeBytes(byte[] b, int offset, int len) throws IOException { assert b != null; while (len > 0) { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } int remainInBuffer = currentBuffer.length - bufferPosition; int bytesToCopy = len < remainInBuffer ? len : remainInBuffer; System.arraycopy(b, offset, currentBuffer, bufferPosition, bytesToCopy); offset += bytesToCopy; len -= bytesToCopy; bufferPosition += bytesToCopy; } }
public void writeBytes(byte[] b, int offset, int len) throws IOException { assert b != null; while (len > 0) { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } int remainInBuffer = currentBuffer.length - bufferPosition; int bytesToCopy = len < remainInBuffer ? len : remainInBuffer; System.arraycopy(b, offset, currentBuffer, bufferPosition, bytesToCopy); offset += bytesToCopy; len -= bytesToCopy; bufferPosition += bytesToCopy; } }
@Override public void writeBytes(byte[] b, int offset, int len) throws IOException { assert b != null; while (len > 0) { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } int remainInBuffer = currentBuffer.length - bufferPosition; int bytesToCopy = len < remainInBuffer ? len : remainInBuffer; System.arraycopy(b, offset, currentBuffer, bufferPosition, bytesToCopy); offset += bytesToCopy; len -= bytesToCopy; bufferPosition += bytesToCopy; } }
@Override public void writeBytes(byte[] b, int offset, int len) throws IOException { assert b != null; if (crc != null) { crc.update(b, offset, len); } while (len > 0) { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } int remainInBuffer = currentBuffer.length - bufferPosition; int bytesToCopy = len < remainInBuffer ? len : remainInBuffer; System.arraycopy(b, offset, currentBuffer, bufferPosition, bytesToCopy); offset += bytesToCopy; len -= bytesToCopy; bufferPosition += bytesToCopy; } }
@Override public void writeBytes(byte[] b, int offset, int len) throws IOException { assert b != null; if (crc != null) { crc.update(b, offset, len); } while (len > 0) { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } int remainInBuffer = currentBuffer.length - bufferPosition; int bytesToCopy = len < remainInBuffer ? len : remainInBuffer; System.arraycopy(b, offset, currentBuffer, bufferPosition, bytesToCopy); offset += bytesToCopy; len -= bytesToCopy; bufferPosition += bytesToCopy; } }
@Override public void writeBytes(byte[] b, int offset, int len) throws IOException { assert b != null; if (crc != null) { crc.update(b, offset, len); } while (len > 0) { if (bufferPosition == bufferLength) { currentBufferIndex++; switchCurrentBuffer(); } int remainInBuffer = currentBuffer.length - bufferPosition; int bytesToCopy = len < remainInBuffer ? len : remainInBuffer; System.arraycopy(b, offset, currentBuffer, bufferPosition, bytesToCopy); offset += bytesToCopy; len -= bytesToCopy; bufferPosition += bytesToCopy; } }
public void seek(long pos) throws IOException { // set the file length in case we seek back // and flush() has not been called yet setFileLength(); if (pos < bufferStart || pos >= bufferStart + bufferLength) { currentBufferIndex = (int) (pos / BUFFER_SIZE); switchCurrentBuffer(); } bufferPosition = (int) (pos % BUFFER_SIZE); }
public void seek(long pos) throws IOException { // set the file length in case we seek back // and flush() has not been called yet setFileLength(); if (pos < bufferStart || pos >= bufferStart + bufferLength) { currentBufferIndex = (int) (pos / BUFFER_SIZE); switchCurrentBuffer(); } bufferPosition = (int) (pos % BUFFER_SIZE); }
@Override public void seek(long pos) throws IOException { // set the file length in case we seek back // and flush() has not been called yet setFileLength(); if (pos < bufferStart || pos >= bufferStart + bufferLength) { currentBufferIndex = (int) (pos / BUFFER_SIZE); switchCurrentBuffer(); } bufferPosition = (int) (pos % BUFFER_SIZE); }