Class IOUtil

java.lang.Object
com.diozero.util.IOUtil

public class IOUtil
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.nio.ByteOrder DEFAULT_BYTE_ORDER  
  • Constructor Summary

    Constructors 
    Constructor Description
    IOUtil()  
  • Method Summary

    Modifier and Type Method Description
    static int asInt​(byte b)
    Get an unsigned int value from a signed byte
    static short getShort​(java.nio.ByteBuffer buffer)  
    static short getShort​(java.nio.ByteBuffer buffer, java.nio.ByteOrder order)  
    static long getUInt​(java.nio.ByteBuffer buffer)  
    static long getUInt​(java.nio.ByteBuffer buffer, int length)  
    static long getUInt​(java.nio.ByteBuffer buffer, int length, java.nio.ByteOrder order)  
    static long getUInt​(java.nio.ByteBuffer buffer, java.nio.ByteOrder order)  
    static int getUShort​(java.nio.ByteBuffer buffer)  
    static int getUShort​(java.nio.ByteBuffer buffer, java.nio.ByteOrder order)  

    Methods inherited from class java.lang.Object

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

  • Constructor Details

  • Method Details

    • asInt

      public static int asInt​(byte b)
      Get an unsigned int value from a signed byte
      Parameters:
      b - input value
      Returns:
      byte values from -127..128 convert 128..255
    • getShort

      public static short getShort​(java.nio.ByteBuffer buffer)
    • getShort

      public static short getShort​(java.nio.ByteBuffer buffer, java.nio.ByteOrder order)
    • getUShort

      public static int getUShort​(java.nio.ByteBuffer buffer)
    • getUShort

      public static int getUShort​(java.nio.ByteBuffer buffer, java.nio.ByteOrder order)
    • getUInt

      public static long getUInt​(java.nio.ByteBuffer buffer)
    • getUInt

      public static long getUInt​(java.nio.ByteBuffer buffer, java.nio.ByteOrder order)
    • getUInt

      public static long getUInt​(java.nio.ByteBuffer buffer, int length)
    • getUInt

      public static long getUInt​(java.nio.ByteBuffer buffer, int length, java.nio.ByteOrder order)