docs: @Override
      protected int writeBytesWireFormat ( byte[] dst, int dstIndex ) {
          int start = dstIndex;
  
          if ( log.isDebugEnabled() ) {
              log.debug("Opening " + this.name);
          }
  
          SMBUtil.writeInt2(57, dst, dstIndex);
          dst[ dstIndex + 2 ] = this.securityFlags;
          dst[ dstIndex + 3 ] = this.requestedOplockLevel;
          dstIndex += 4;
  
          SMBUtil.writeInt4(this.impersonationLevel, dst, dstIndex);
          dstIndex += 4;
          SMBUtil.writeInt8(this.smbCreateFlags, dst, dstIndex);
          dstIndex += 8;
          dstIndex += 8; // Reserved
  
          SMBUtil.writeInt4(this.desiredAccess, dst, dstIndex);
          dstIndex += 4;
          SMBUtil.writeInt4(this.fileAttributes, dst, dstIndex);
          dstIndex += 4;
          SMBUtil.writeInt4(this.shareAccess, dst, dstIndex);
          dstIndex += 4;
          SMBUtil.writeInt4(this.createDisposition, dst, dstIndex);
          dstIndex += 4;
          SMBUtil.writeInt4(this.createOptions, dst, dstIndex);
          dstIndex += 4;
  
          int nameOffsetOffset = dstIndex;
          byte[] nameBytes = this.name.getBytes(StandardCharsets.UTF_16LE);
          SMBUtil.writeInt2(nameBytes.length, dst, dstIndex + 2);
          dstIndex += 4;
  
          int createContextOffsetOffset = dstIndex;
          dstIndex += 4; // createContextOffset
          int createContextLengthOffset = dstIndex;
          dstIndex += 4; // createContextLength
  
          SMBUtil.writeInt2(dstIndex - getHeaderStart(), dst, nameOffsetOffset);
  
          System.arraycopy(nameBytes, 0, dst, dstIndex, nameBytes.length);
          if ( nameBytes.length == 0 ) {
              // buffer must contain at least one byte
              dstIndex++;
          }
          else {
              dstIndex += nameBytes.length;
          }
  
          dstIndex += pad8(dstIndex);
  
          if ( this.createContexts == null || this.createContexts.length == 0 ) {
              SMBUtil.writeInt4(0, dst, createContextOffsetOffset);
          }
          else {
              SMBUtil.writeInt4(dstIndex - getHeaderStart(), dst, createContextOffsetOffset);
          }
          int totalCreateContextLength = 0;
          if ( this.createContexts != null ) {
              int lastStart = -1;
              for ( CreateContextRequest createContext : this.createContexts ) {
                  int structStart = dstIndex;
  
                  SMBUtil.writeInt4(0, dst, structStart); // Next
                  if ( lastStart > 0 ) {
                      // set next pointer of previous CREATE_CONTEXT
                      SMBUtil.writeInt4(structStart - dstIndex, dst, lastStart);
                  }
  
                  dstIndex += 4;
                  byte[] cnBytes = createContext.getName();
                  int cnOffsetOffset = dstIndex;
                  SMBUtil.writeInt2(cnBytes.length, dst, dstIndex + 2);
                  dstIndex += 4;
  
                  int dataOffsetOffset = dstIndex + 2;
                  dstIndex += 4;
                  int dataLengthOffset = dstIndex;
                  dstIndex += 4;
  
                  SMBUtil.writeInt2(dstIndex - structStart, dst, cnOffsetOffset);
                  System.arraycopy(cnBytes, 0, dst, dstIndex, cnBytes.length);
                  dstIndex += cnBytes.length;
                  dstIndex += pad8(dstIndex);
  
                  SMBUtil.writeInt2(dstIndex - structStart, dst, dataOffsetOffset);
                  int len = createContext.encode(dst, dstIndex);
                  SMBUtil.writeInt4(len, dst, dataLengthOffset);
                  dstIndex += len;
  
                  int pad = pad8(dstIndex);
                  totalCreateContextLength += len + pad;
                  dstIndex += pad;
                  lastStart = structStart;
              }
          }
          SMBUtil.writeInt4(totalCreateContextLength, dst, createContextLengthOffset);
          return dstIndex - start;
      }