Class AltsFraming

java.lang.Object
io.grpc.alts.internal.AltsFraming

public final class AltsFraming extends Object
Framing and deframing methods and classes used by handshaker.
  • Field Details

  • Constructor Details

    • AltsFraming

      private AltsFraming()
  • Method Details

    • getFrameLengthHeaderSize

      static int getFrameLengthHeaderSize()
    • getFrameMessageTypeHeaderSize

      static int getFrameMessageTypeHeaderSize()
    • getMaxDataLength

      static int getMaxDataLength()
    • getFramingOverhead

      static int getFramingOverhead()
    • toFrame

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

      private static void copy(ByteBuffer dst, 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.