Class AltsFraming


  • public final class AltsFraming
    extends java.lang.Object
    Framing and deframing methods and classes used by handshaker.
    • Constructor Detail

      • AltsFraming

        private AltsFraming()
    • Method Detail

      • getFrameLengthHeaderSize

        static int getFrameLengthHeaderSize()
      • getFrameMessageTypeHeaderSize

        static int getFrameMessageTypeHeaderSize()
      • getMaxDataLength

        static int getMaxDataLength()
      • getFramingOverhead

        static int getFramingOverhead()
      • toFrame

        static java.nio.ByteBuffer toFrame​(java.nio.ByteBuffer input,
                                           int dataSize)
                                    throws java.security.GeneralSecurityException
        Creates a frame of length dataSize + FRAME_HEADER_SIZE using the input bytes, if dataSize <= input.remaining(). Otherwise, a frame of length input.remaining() + FRAME_HEADER_SIZE is created.
        Throws:
        java.security.GeneralSecurityException
      • copy

        private static void copy​(java.nio.ByteBuffer dst,
                                 java.nio.ByteBuffer src)
        Copy as much as possible to dst from src. Unlike ByteBuffer.put(ByteBuffer), this stops early if there is no room left in dst.