{@inheritDoc}

@see jcifs.internal.smb1.ServerMessageBlock#writeParameterWordsWireFormat(byte[], int)
500759
@Override
    protected int writeParameterWordsWireFormat ( byte[] dst, int dstIndex ) {
        int start = dstIndex;
        SMBUtil.writeInt2(this.fid, dst, dstIndex);
        dstIndex += 2;
        SMBUtil.writeInt2(this.mode, dst, dstIndex);
        dstIndex += 2;
        SMBUtil.writeInt4(this.offset, dst, dstIndex);
        dstIndex += 4;
        return dstIndex - start;
    }
1094195
public void writeByte(byte value) throws UnsupportedEncodingException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeByte", Byte.valueOf(value));
    getBodyList().add(Byte.valueOf(value));
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "writeByte");
  }
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;
    }
746656
@Override
    protected int writeBytesWireFormat ( byte[] dst, int dstIndex ) {
        int start = dstIndex;

        SMBUtil.writeInt2(25, dst, dstIndex);

        dst[ dstIndex + 2 ] = (byte) ( this.sessionBinding ? 0x1 : 0 );
        dst[ dstIndex + 3 ] = (byte) ( this.securityMode );
        dstIndex += 4;

        SMBUtil.writeInt4(this.capabilities, dst, dstIndex);
        dstIndex += 4;
        SMBUtil.writeInt4(0, dst, dstIndex); // Channel
        dstIndex += 4;

        int offsetOffset = dstIndex;
        dstIndex += 2;
        SMBUtil.writeInt2(this.token != null ? this.token.length : 0, dst, dstIndex);
        dstIndex += 2;
        SMBUtil.writeInt8(this.previousSessionId, dst, dstIndex);
        dstIndex += 8;
        SMBUtil.writeInt2(dstIndex - getHeaderStart(), dst, offsetOffset);

        dstIndex += pad8(dstIndex);

        if ( this.token != null ) {
            System.arraycopy(this.token, 0, dst, dstIndex, this.token.length);
            dstIndex += this.token.length;
        }

        return dstIndex - start;
    }
1339289
public void write(byte b[], int off, int len)
        throws IOException
    {     
        len=prepareOutput(len);
        if (!_nulled)
            _out.write(b,off,len);
        if (_bytes==_contentLength)
            flush();
    }
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;
    }
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;
    }
343744
@Override
    public void write(byte bbuf[], int off, int len) throws IOException {
    	for(OutputStream os : oss) {
    		os.write(bbuf,off,len);
    	}
    }
1327504
public static void writeRawVarint64(OutputStream os, long value) throws IOException {
        while (true) {
            if ((value & ~0x7FL) == 0) {
                os.write((int) value);
                return;
            } else {
                os.write(((int) value & 0x7F) | 0x80);
                value >>>= 7;
            }
        }
    }
1243990
@Override
  public void write(byte[] b, int off, int len) throws IOException {
    textArea.append(new String(b, off, len));
  }
371783
@Override
  public void write(int b) throws IOException {
    if (!writtenHeader) {
      writeHeader();
      writtenHeader = true;
    }
    cipherStream.write(b);
  }
291224
@Override
    protected int readBytesWireFormat ( byte[] buffer, int bufferIndex ) throws SMBProtocolDecodingException {
        int structureSize = SMBUtil.readInt2(buffer, bufferIndex);
        if ( structureSize != 2 ) {
            throw new SMBProtocolDecodingException("Expected structureSize = 2");
        }
        return 2;
    }
766933
public void writeRawBytes(final byte[] value, int offset, int length)
                            throws IOException {
    if (limit - position >= length) {
      // We have room in the current buffer.
      System.arraycopy(value, offset, buffer, position, length);
      position += length;
    } else {
      // Write extends past current buffer.  Fill the rest of this buffer and
      // flush.
      final int bytesWritten = limit - position;
      System.arraycopy(value, offset, buffer, position, bytesWritten);
      offset += bytesWritten;
      length -= bytesWritten;
      position = limit;
      refreshBuffer();

      // Now deal with the rest.
      // Since we have an output stream, this is our buffer
      // and buffer offset == 0
      if (length <= limit) {
        // Fits in new buffer.
        System.arraycopy(value, offset, buffer, 0, length);
        position = length;
      } else {
        // Write is very big.  Let's do it all at once.
        output.write(value, offset, length);
      }
    }
  }
254379
@Override
    protected int writeBytesWireFormat ( byte[] dst, int dstIndex ) {
        SMBUtil.writeInt2(4, dst, dstIndex);
        SMBUtil.writeInt2(0, dst, dstIndex + 2);
        return 4;
    }
964224
@Override
    public void write(@Sensitive byte[] b, int off, int len) throws IOException {
        this.output.write(b, off, len);
    }
1198390
static void writeRawVarint32(ByteBuf out, int value) {
        while (true) {
            if ((value & ~0x7F) == 0) {
                out.writeByte(value);
                return;
            } else {
                out.writeByte((value & 0x7F) | 0x80);
                value >>>= 7;
            }
        }
    }
9696
@Override
	public void writeInt(int value) throws JMSException
    {
        try
        {
            getOutput().writeInt(value);
        }
        catch (IOException e)
        {
            throw new FFMQException("Cannot write message body","IO_ERROR",e);
        }
    }