@Override protected int writeParametersWireFormat ( byte[] dst, int dstIndex ) { int start = dstIndex; byte[] descr; int which = getSubCommand() == NET_SERVER_ENUM2 ? 0 : 1; try { descr = DESCR[ which ].getBytes("ASCII"); } catch ( UnsupportedEncodingException uee ) { return 0; } SMBUtil.writeInt2(getSubCommand() & 0xFF, dst, dstIndex); dstIndex += 2; System.arraycopy(descr, 0, dst, dstIndex, descr.length); dstIndex += descr.length; SMBUtil.writeInt2(0x0001, dst, dstIndex); dstIndex += 2; SMBUtil.writeInt2(this.maxDataCount, dst, dstIndex); dstIndex += 2; SMBUtil.writeInt4(this.serverTypes, dst, dstIndex); dstIndex += 4; dstIndex += writeString(this.domain.toUpperCase(), dst, dstIndex, false); if ( which == 1 ) { dstIndex += writeString(this.lastName.toUpperCase(), dst, dstIndex, false); } return dstIndex - start; }
@Override protected int writeParametersWireFormat ( byte[] dst, int dstIndex ) { int start = dstIndex; byte[] descr; int which = getSubCommand() == NET_SERVER_ENUM2 ? 0 : 1; try { descr = DESCR[ which ].getBytes("ASCII"); } catch ( UnsupportedEncodingException uee ) { return 0; } SMBUtil.writeInt2(getSubCommand() & 0xFF, dst, dstIndex); dstIndex += 2; System.arraycopy(descr, 0, dst, dstIndex, descr.length); dstIndex += descr.length; SMBUtil.writeInt2(0x0001, dst, dstIndex); dstIndex += 2; SMBUtil.writeInt2(this.maxDataCount, dst, dstIndex); dstIndex += 2; SMBUtil.writeInt4(this.serverTypes, dst, dstIndex); dstIndex += 4; dstIndex += writeString(this.domain.toUpperCase(), dst, dstIndex, false); if ( which == 1 ) { dstIndex += writeString(this.lastName.toUpperCase(), dst, dstIndex, false); } return dstIndex - start; }