/** {@inheritDoc} */ public void write(final byte[] b) throws IOException { byteOutput.write(b); }
/** {@inheritDoc} */ public void write(final byte[] b, final int off, final int len) throws IOException { byteOutput.write(b, off, len); }
@Override public void write(byte[] b) throws IOException { delegate.write(b); }
@Override public void write(int b) throws IOException { delegate.write(b); }
@Override public void write(byte[] b, int off, int len) throws IOException { delegate.write(b, off, len); }
/** {@inheritDoc} */ public void write(final int b) throws IOException { byteOutput.write(b); }
@Override public void write(int b) throws IOException { delegate.write(b); }
@Override public void write(byte[] b) throws IOException { delegate.write(b); }
@Override public void write(byte[] b, int off, int len) throws IOException { delegate.write(b, off, len); }
public void writeHeader(final ByteOutput output) throws IOException { output.write(headerBytes); }
/** * This shallow flush will write the internal buffer out to the {@code ByteOutput}, but will not flush it. * * @throws java.io.IOException if an I/O error occurs */ protected void shallowFlush() throws IOException { final int pos = position; final ByteOutput byteOutput = this.byteOutput; if (byteOutput != null) { if (pos > 0) { byteOutput.write(buffer, 0, pos); } position = 0; } }
/** {@inheritDoc} */ public void write(final byte[] bytes, final int off, int len) throws IOException { final int bl = buffer.length; final int position = this.position; if (len > bl - position || len > bl >> 3) { flush(); byteOutput.write(bytes, off, len); } else { System.arraycopy(bytes, off, buffer, position, len); this.position = position + len; } }
/** {@inheritDoc} */ public void flush() throws IOException { final int pos = position; final ByteOutput byteOutput = this.byteOutput; if (byteOutput != null) { if (pos > 0) { byteOutput.write(buffer, 0, pos); } position = 0; byteOutput.flush(); } }
public void writeInt(final int i) throws IOException { final ByteOutput output = this.output; byte[] bytes = new byte[4]; bytes[0] = (byte) (i >> 24); bytes[1] = (byte) (i >> 16); bytes[2] = (byte) (i >> 8); bytes[3] = (byte) i; output.write(bytes); } }
void writeNoBlockFlush(final byte[] bytes, final int off, int len) throws IOException { super.flush(); byteOutput.write(bytes, off, len); } }
void writeNoBlockFlush(final byte[] bytes, final int off, int len) throws IOException { super.flush(); byteOutput.write(bytes, off, len); } }
/** {@inheritDoc} */ public void flush() throws IOException { final int pos = position; final ByteOutput byteOutput = this.byteOutput; if (byteOutput != null) { if (pos > 0) { byteOutput.write(buffer, 0, pos); } position = 0; byteOutput.flush(); } }
/** {@inheritDoc} */ public void write(final byte[] bytes, final int off, int len) throws IOException { final int bl = buffer.length; final int position = this.position; if (len > bl - position || len > bl >> 3) { flush(); byteOutput.write(bytes, off, len); } else { System.arraycopy(bytes, off, buffer, position, len); this.position = position + len; } }
/** {@inheritDoc} */ public void flush() throws IOException { final int pos = position; final ByteOutput byteOutput = this.byteOutput; if (byteOutput != null) { if (pos > 0) { byteOutput.write(buffer, 0, pos); } position = 0; byteOutput.flush(); } }