{@inheritDoc}

@see jcifs.internal.smb1.ServerMessageBlock#writeBytesWireFormat(byte[], int)
556530
@Override
    protected int writeBytesWireFormat ( byte[] dst, int dstIndex ) {
        int start = dstIndex;
        if ( this.unlocks != null ) {
            for ( LockingAndXRange lockingAndXRange : this.unlocks ) {
                dstIndex += lockingAndXRange.encode(dst, dstIndex);
            }
        }
        if ( this.locks != null ) {
            for ( LockingAndXRange lockingAndXRange : this.locks ) {
                dstIndex += lockingAndXRange.encode(dst, dstIndex);
            }
        }
        return start - dstIndex;
    }
741625
@Override
    protected int writeBytesWireFormat ( byte[] dst, int dstIndex ) {
        int start = dstIndex;
        SMBUtil.writeInt2(49, dst, dstIndex);
        dst[ dstIndex + 2 ] = this.padding;
        dst[ dstIndex + 3 ] = this.readFlags;
        dstIndex += 4;
        SMBUtil.writeInt4(this.readLength, dst, dstIndex);
        dstIndex += 4;
        SMBUtil.writeInt8(this.offset, dst, dstIndex);
        dstIndex += 8;
        System.arraycopy(this.fileId, 0, dst, dstIndex, 16);
        dstIndex += 16;
        SMBUtil.writeInt4(this.minimumCount, dst, dstIndex);
        dstIndex += 4;
        SMBUtil.writeInt4(this.channel, dst, dstIndex);
        dstIndex += 4;
        SMBUtil.writeInt4(this.remainingBytes, dst, dstIndex);
        dstIndex += 4;

        // ReadChannelInfo
        SMBUtil.writeInt2(0, dst, dstIndex);
        SMBUtil.writeInt2(0, dst, dstIndex + 2);
        dstIndex += 4;

        // one byte in buffer must be zero
        dst[ dstIndex ] = 0;
        dstIndex += 1;

        return dstIndex - start;
    }
874000
@Override
    protected int readBytesWireFormat ( byte[] buffer, int bufferIndex ) throws SMBProtocolDecodingException {
        int start = bufferIndex;

        int structureSize = SMBUtil.readInt2(buffer, bufferIndex);
        if ( structureSize != 9 ) {
            throw new SMBProtocolDecodingException("Expected structureSize = 9");
        }

        int bufferOffset = SMBUtil.readInt2(buffer, bufferIndex + 2) + getHeaderStart();
        bufferIndex += 4;
        int bufferLength = SMBUtil.readInt4(buffer, bufferIndex);
        bufferIndex += 4;
        Decodable i = createInformation(this.expectInfoType, this.expectInfoClass);
        if ( i != null ) {
            i.decode(buffer, bufferOffset, bufferLength);
        }
        bufferIndex = Math.max(bufferIndex, bufferOffset + bufferLength);
        this.info = i;
        return bufferIndex - start;
    }
471137
public void writeBytes(byte[] buffer)
        throws IOException
    {
        if (buffer == null)
            os.write('N');
        else
            writeBytes(buffer, 0, buffer.length);
    }
476405
@Override
    protected int readBytesWireFormat ( byte[] buffer, int bufferIndex ) throws SMBProtocolDecodingException {
        int start = bufferIndex;
        int structureSize = SMBUtil.readInt2(buffer, bufferIndex);

        if ( structureSize != 9 ) {
            throw new SMBProtocolDecodingException("Expected structureSize = 9");
        }

        int bufferOffset = SMBUtil.readInt2(buffer, bufferIndex + 2) + getHeaderStart();
        bufferIndex += 4;
        int bufferLength = SMBUtil.readInt4(buffer, bufferIndex);
        bufferIndex += 4;

        // bufferIndex = bufferOffset;

        List<FileEntry> infos = new ArrayList<>();
        do {
            FileBothDirectoryInfo cur = createFileInfo();
            if ( cur == null ) {
                break;
            }
            cur.decode(buffer, bufferIndex, bufferLength);
            infos.add(cur);
            int nextEntryOffset = cur.getNextEntryOffset();
            if ( nextEntryOffset > 0 ) {
                bufferIndex += nextEntryOffset;
            }
            else {
                break;
            }
        }
        while ( bufferIndex < bufferOffset + bufferLength );
        this.results = infos.toArray(new FileEntry[infos.size()]);
        return bufferIndex - start;
    }
861241
public void writeBytes(byte[] value) throws UnsupportedEncodingException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeBytes", value);
    getBodyList().add(value);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "writeBytes");
  }
523279
@Override
    public void write(byte[] bts, int st, int end) throws IOException {
        try {
            beforeWrite(end);
            out.write(bts, st, end);
            afterWrite(end);
        } catch (IOException e) {
            handleIOException(e);
        }
    }
706695
public void writeBytes(byte[] data, int offset, int length) throws IOException
    {
        prepareValue();
        updateLength(length);
        buffer.writeBytes(data, offset, length);
        finishValue();
    }
819273
public static void writeBytes(byte[] bytes, OutputStream os) throws IOException {
		
		BufferedOutputStream bos = new BufferedOutputStream(os);
		
		ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
		
		byte[] buf = new byte[1028];
		
		int len;
		while ((len = bis.read(buf, 0, buf.length)) > -1){
			bos.write(buf, 0, len);
		}
		
		bos.flush();
		bos.close();
		
		bis.close();
	}
475722
@Override
    protected int readBytesWireFormat ( byte[] buffer, int bufferIndex ) throws SMBProtocolDecodingException {
        int start = bufferIndex;
        int structureSize = SMBUtil.readInt2(buffer, bufferIndex);
        if ( structureSize != 24 ) {
            throw new SMBProtocolDecodingException("Expected structureSize = 24");
        }

        this.oplockLevel = buffer[ bufferIndex + 2 ];
        bufferIndex += 4;
        bufferIndex += 4; // Reserved2

        this.fileId = new byte[16];
        System.arraycopy(buffer, bufferIndex, this.fileId, 0, 16);
        bufferIndex += 16;

        return bufferIndex - start;
    }
273986
public void write(byte[] value, int start, int len) throws IOException
  {
    this.output.write(value, start, len);
  }
1220590
public void writeBytes(byte[] buffer, int offset, int length)
        throws IOException
    {
        if (buffer == null) {
            os.write('N');
        }
        else {
            while (length > 0x8000) {
                int sublen = 0x8000;

                os.write('b');
                os.write(sublen >> 8);
                os.write(sublen);

                os.write(buffer, offset, sublen);

                length -= sublen;
                offset += sublen;
            }

            os.write('B');
            os.write(length >> 8);
            os.write(length);
            os.write(buffer, offset, length);
        }
    }
395464
void writeBytes(byte[] bytes) throws IOException {
        int size = bytes.length;
        if (size < 256) {
            output.writeByte(BIN_8);
            output.writeByte(size);
        } else if (size < 65536) {
            output.writeByte(BIN_16);
            output.writeShort(size);
        } else {
            output.writeByte(BIN_32);
            output.writeInt(size);
        }
        output.write(bytes);
    }
873830
public void write(byte value) {
        if (count >= content.length - 1) {
            byte[] ns = new byte[content.length + 8];
            System.arraycopy(content, 0, ns, 0, count);
            this.content = ns;
        }
        content[count++] = value;
    }
356863
public void write(byte[] b) throws IOException
	{
		if (b == null)
			throw new NullPointerException();
		p.writeBytes(b, 0, b.length);
	}
1160037
@Override
    protected int writeBytesWireFormat ( byte[] dst, int dstIndex ) {
        int start = dstIndex;

        SMBUtil.writeInt2(41, dst, dstIndex);
        dst[ dstIndex + 2 ] = this.infoType;
        dst[ dstIndex + 3 ] = this.fileInfoClass;
        dstIndex += 4;

        SMBUtil.writeInt4(this.outputBufferLength, dst, dstIndex);
        dstIndex += 4;
        int inBufferOffsetOffset = dstIndex;
        dstIndex += 4;
        int inBufferLengthOffset = dstIndex;
        dstIndex += 4;
        SMBUtil.writeInt4(this.additionalInformation, dst, dstIndex);
        dstIndex += 4;
        SMBUtil.writeInt4(this.queryFlags, dst, dstIndex);
        dstIndex += 4;
        System.arraycopy(this.fileId, 0, dst, dstIndex, 16);
        dstIndex += 16;

        if ( this.inputBuffer == null ) {
            SMBUtil.writeInt2(0, dst, inBufferOffsetOffset);
            SMBUtil.writeInt4(0, dst, inBufferLengthOffset);
        }
        else {
            SMBUtil.writeInt2(dstIndex - getHeaderStart(), dst, inBufferOffsetOffset);
            int len = this.inputBuffer.encode(dst, dstIndex);
            SMBUtil.writeInt4(len, dst, inBufferLengthOffset);
            dstIndex += len;
        }
        return dstIndex - start;
    }
1105797
public void writeBytesLenenc(final byte[] value) {
        if (0 == value.length) {
            byteBuf.writeByte(0);
            return;
        }
        writeIntLenenc(value.length);
        byteBuf.writeBytes(value);
    }