Class CfdpUtils


  • public class CfdpUtils
    extends Object
    • Constructor Detail

      • CfdpUtils

        public CfdpUtils()
    • Method Detail

      • isBitOfByteSet

        public static boolean isBitOfByteSet​(Byte input,
                                             int bitnr)
      • getBitOfByte

        public static int getBitOfByte​(Byte input,
                                       int bitnr)
      • getUnsignedByte

        public static short getUnsignedByte​(ByteBuffer buffer)
      • writeUnsignedByte

        public static void writeUnsignedByte​(ByteBuffer buffer,
                                             int input)
      • getUnsignedShort

        public static int getUnsignedShort​(ByteBuffer buffer)
      • getUnsignedInt

        public static long getUnsignedInt​(ByteBuffer buffer)
        get an unsigned int value from an input buffer, at its current position A short has range -2ˆ31+1 to 2ˆ31-1, while we want 0 to 2ˆ32-1, the mask and int cast takes care of this
      • writeUnsignedInt

        public static void writeUnsignedInt​(ByteBuffer buffer,
                                            long input)
        Write the given long as an unsigned int to the given buffer at its current position
      • getUnsignedLongFromBuffer

        public static Long getUnsignedLongFromBuffer​(ByteBuffer buffer,
                                                     int nrOfBytesToRead)
      • boolToByte

        public static byte boolToByte​(boolean bool)
      • getUnsignedLongFromByteArray

        public static long getUnsignedLongFromByteArray​(byte[] input)
      • longToBytes

        public static byte[] longToBytes​(long input,
                                         int length)