@Override public void write(int b) throws IOException { reserve(1); data[offset] = (byte) b; offset++; }
@Override public void write(int b) throws IOException { reserve(1); data[offset] = (byte) b; offset++; }
/** * Adds bytes to this writer's buffer. * * @param bytes byte array * @param off offset into array to start copying bytes * @param length number of bytes to add * @throws IndexOutOfBoundsException if off or length are invalid */ public void write(byte[] bytes, int off, int length) { reserve(length); System.arraycopy(bytes, off, data, offset, length); offset += length; }
/** * Adds bytes to this writer's buffer. * * @param bytes byte array * @param off offset into array to start copying bytes * @param length number of bytes to add * @throws IndexOutOfBoundsException if off or length are invalid */ public void write(byte[] bytes, int off, int length) { reserve(length); System.arraycopy(bytes, off, data, offset, length); offset += length; }