/** * Write a 16 bit short as LITTLE_ENDIAN. * * @param v the short to write * @return the Short in a byte[] */ public static final byte[] writeShort(short v) { return writeShort(v, new byte[2], 0); }
/** * Write a 16 bit short as LITTLE_ENDIAN. * * @param v the short to write * @return the Short in a byte[] */ public static final byte[] writeShort(short v) { return writeShort(v, new byte[2], 0); }
/** * Write a 16 bit short as LITTLE_ENDIAN. * * @param v the short to write */ public static byte[] writeShort(short v) { return writeShort(v, new byte[2], 0); }
/** * Writes a security buffer to the given array <code>b</code> at offset * <code>offset</code>. A security buffer defines a pointer to an area * in the data that defines some data with a variable length. This allows * to have a semi-fixed length header thus making a little bit easier * the decoding process in the NTLM protocol. * * @param length the length of the security buffer * @param allocated the allocated space for the security buffer (should be * greater or equal to <code>length</code> * @param bufferOffset the offset from the main array where the currently * defined security buffer will be written * @param b the buffer in which we write the security buffer * @param offset the offset at which to write to the b buffer */ public static final void writeSecurityBuffer(short length, short allocated, int bufferOffset, byte[] b, int offset) { ByteUtilities.writeShort(length, b, offset); ByteUtilities.writeShort(allocated, b, offset + 2); ByteUtilities.writeInt(bufferOffset, b, offset + 4); }
/** * Writes a security buffer to the given array <code>b</code> at offset * <code>offset</code>. A security buffer defines a pointer to an area * in the data that defines some data with a variable length. This allows * to have a semi-fixed length header thus making a little bit easier * the decoding process in the NTLM protocol. * * @param length the length of the security buffer * @param allocated the allocated space for the security buffer (should be * greater or equal to <code>length</code> * @param bufferOffset the offset from the main array where the currently * defined security buffer will be written * @param b the buffer in which we write the security buffer * @param offset the offset at which to write to the b buffer */ public static final void writeSecurityBuffer(short length, short allocated, int bufferOffset, byte[] b, int offset) { ByteUtilities.writeShort(length, b, offset); ByteUtilities.writeShort(allocated, b, offset + 2); ByteUtilities.writeInt(bufferOffset, b, offset + 4); }
/** * Writes a security buffer to the given array <code>b</code> at offset * <code>offset</code>. A security buffer defines a pointer to an area * in the data that defines some data with a variable length. This allows * to have a semi-fixed length header thus making a little bit easier * the decoding process in the NTLM protocol. * * @param length the length of the security buffer * @param allocated the allocated space for the security buffer (should be * greater or equal to <code>length</code> * @param bufferOffset the offset from the main array where the currently * defined security buffer will be written * @param b the buffer in which we write the security buffer * @param offset the offset at which to write to the b buffer */ public static void writeSecurityBuffer(short length, short allocated, int bufferOffset, byte[] b, int offset) { ByteUtilities.writeShort(length, b, offset); ByteUtilities.writeShort(allocated, b, offset + 2); ByteUtilities.writeInt(bufferOffset, b, offset + 4); }