Class Sequence

  • Direct Known Subclasses:
    LDAPMessage, LDAPResult, SearchResultEntry

    public class Sequence
    extends java.lang.Object
    This class implements reading and writing sequences. Instantiate with an InputStream or ByteBuffer to populate the internal buffer with sequence data. Instantiate with a tag and optionally initial buffer size to create a sequence. The internal buffer automatically adjusts when adding data to it. NOTE! Call getBuffer() only ONCE! The call to getBuffer() updates the entire ByteBuffer with sequence tag and size followed by the sequence data.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.nio.ByteBuffer buffer  
      int tag  
    • Constructor Summary

      Constructors 
      Constructor Description
      Sequence​(int tag)  
      Sequence​(int tag, int size)  
      Sequence​(int tag, int size, boolean addlen)  
      Sequence​(java.io.InputStream is, boolean gettype)  
      Sequence​(java.nio.ByteBuffer is, boolean gettype)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addBuffer​(Sequence seq)  
      void addBuffer​(java.nio.ByteBuffer buf)  
      java.nio.ByteBuffer flip()  
      java.nio.ByteBuffer getBuffer()  
      static java.nio.ByteBuffer getBuffer​(java.nio.ByteBuffer buf)  
      static java.nio.ByteBuffer getBuffer​(java.nio.ByteBuffer buf, boolean readtag)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • buffer

        public java.nio.ByteBuffer buffer
      • tag

        public int tag
    • Constructor Detail

      • Sequence

        public Sequence​(java.io.InputStream is,
                        boolean gettype)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • Sequence

        public Sequence​(java.nio.ByteBuffer is,
                        boolean gettype)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • Sequence

        public Sequence​(int tag)
      • Sequence

        public Sequence​(int tag,
                        int size)
      • Sequence

        public Sequence​(int tag,
                        int size,
                        boolean addlen)
    • Method Detail

      • addBuffer

        public void addBuffer​(java.nio.ByteBuffer buf)
      • addBuffer

        public void addBuffer​(Sequence seq)
      • getBuffer

        public static java.nio.ByteBuffer getBuffer​(java.nio.ByteBuffer buf)
                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getBuffer

        public static java.nio.ByteBuffer getBuffer​(java.nio.ByteBuffer buf,
                                                    boolean readtag)
                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getBuffer

        public java.nio.ByteBuffer getBuffer()
      • flip

        public java.nio.ByteBuffer flip()