Class HeapInvocationBuffer.Encoder

    • Constructor Summary

      Constructors 
      Constructor Description
      Encoder()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract int getBufferSize​(CallContext callContext)
      Gets the size in bytes of the buffer required for the function
      (package private) static HeapInvocationBuffer.Encoder getInstance()  
      abstract int putAddress​(byte[] buffer, int offset, long value)
      Encodes a native memory address value into the byte array.
      abstract int putByte​(byte[] buffer, int offset, int value)
      Encodes a byte value into the byte array.
      abstract int putDouble​(byte[] buffer, int offset, double value)
      Encodes a double value into the byte array.
      abstract int putFloat​(byte[] buffer, int offset, float value)
      Encodes a float value into the byte array.
      abstract int putInt​(byte[] buffer, int offset, int value)
      Encodes an int value into the byte array.
      abstract int putLong​(byte[] buffer, int offset, long value)
      Encodes a long value into the byte array.
      abstract int putShort​(byte[] buffer, int offset, int value)
      Encodes a short value into the byte array.
      abstract int skipAddress​(int offset)  
      • Methods inherited from class java.lang.Object

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

      • Encoder

        Encoder()
    • Method Detail

      • getBufferSize

        public abstract int getBufferSize​(CallContext callContext)
        Gets the size in bytes of the buffer required for the function
      • putByte

        public abstract int putByte​(byte[] buffer,
                                    int offset,
                                    int value)
        Encodes a byte value into the byte array.
        Parameters:
        buffer - The destination byte buffer to place the encoded value.
        offset - The offset within the destination buffer to place the value.
        value - The value to encode.
        Returns:
        The number of bytes consumed in encoding the value.
      • putShort

        public abstract int putShort​(byte[] buffer,
                                     int offset,
                                     int value)
        Encodes a short value into the byte array.
        Parameters:
        buffer - The destination byte buffer to place the encoded value.
        offset - The offset within the destination buffer to place the value.
        value - The value to encode.
        Returns:
        The number of bytes consumed in encoding the value.
      • putInt

        public abstract int putInt​(byte[] buffer,
                                   int offset,
                                   int value)
        Encodes an int value into the byte array.
        Parameters:
        buffer - The destination byte buffer to place the encoded value.
        offset - The offset within the destination buffer to place the value.
        value - The value to encode.
        Returns:
        The number of bytes consumed in encoding the value.
      • putLong

        public abstract int putLong​(byte[] buffer,
                                    int offset,
                                    long value)
        Encodes a long value into the byte array.
        Parameters:
        buffer - The destination byte buffer to place the encoded value.
        offset - The offset within the destination buffer to place the value.
        value - The value to encode.
        Returns:
        The number of bytes consumed in encoding the value.
      • putFloat

        public abstract int putFloat​(byte[] buffer,
                                     int offset,
                                     float value)
        Encodes a float value into the byte array.
        Parameters:
        buffer - The destination byte buffer to place the encoded value.
        offset - The offset within the destination buffer to place the value.
        value - The value to encode.
        Returns:
        The number of bytes consumed in encoding the value.
      • putDouble

        public abstract int putDouble​(byte[] buffer,
                                      int offset,
                                      double value)
        Encodes a double value into the byte array.
        Parameters:
        buffer - The destination byte buffer to place the encoded value.
        offset - The offset within the destination buffer to place the value.
        value - The value to encode.
        Returns:
        The number of bytes consumed in encoding the value.
      • putAddress

        public abstract int putAddress​(byte[] buffer,
                                       int offset,
                                       long value)
        Encodes a native memory address value into the byte array.
        Parameters:
        buffer - The destination byte buffer to place the encoded value.
        offset - The offset within the destination buffer to place the value.
        value - The value to encode.
        Returns:
        The number of bytes consumed in encoding the value.
      • skipAddress

        public abstract int skipAddress​(int offset)