Module jcifs

Class PacUnicodeString

java.lang.Object
org.codelibs.jcifs.smb.pac.PacUnicodeString

public class PacUnicodeString extends Object
Represents a Unicode string structure as used in PAC data. This class encapsulates the metadata for a Unicode string including its length, maximum length, and pointer to the actual string data.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PacUnicodeString(short length, short maxLength, int pointer)
    Constructs a new PacUnicodeString instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    check(String string)
    Validates the provided string against this structure's metadata.
    short
    Gets the actual length of the string in bytes.
    short
    Gets the maximum allocated length for the string in bytes.
    int
    Gets the pointer/offset to the string data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PacUnicodeString

      public PacUnicodeString(short length, short maxLength, int pointer)
      Constructs a new PacUnicodeString instance.
      Parameters:
      length - the actual length of the string in bytes
      maxLength - the maximum allocated length for the string in bytes
      pointer - the pointer/offset to the string data
  • Method Details

    • getLength

      public short getLength()
      Gets the actual length of the string in bytes.
      Returns:
      the string length
    • getMaxLength

      public short getMaxLength()
      Gets the maximum allocated length for the string in bytes.
      Returns:
      the maximum string length
    • getPointer

      public int getPointer()
      Gets the pointer/offset to the string data.
      Returns:
      the pointer to the string data
    • check

      public String check(String string) throws PACDecodingException
      Validates the provided string against this structure's metadata. Checks that the string length matches the expected length and that null strings have a zero pointer.
      Parameters:
      string - the string to validate
      Returns:
      the validated string
      Throws:
      PACDecodingException - if validation fails