Package com.peterphi.std.io.nio
Class NIOHelper
java.lang.Object
com.peterphi.std.io.nio.NIOHelper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ByteBuffer
blockingRead
(SocketChannel so, long timeout, byte[] bytes) static ByteBuffer
blockingRead
(SocketChannel so, long timeout, int bytes) static int
bytesToInt
(byte[] bytes) static int
static int[]
bytesToInts
(byte[] bytes) static long
bytesToLong
(byte[] bytes) static long
static byte[]
intsToBytes
(int[] n) static byte[]
intsToBytes
(List<Integer> n) static byte[]
intToBytes
(int n) static byte[]
longToBytes
(long n)
-
Constructor Details
-
NIOHelper
public NIOHelper()
-
-
Method Details
-
intsToBytes
public static byte[] intsToBytes(int[] n) -
intsToBytes
-
bytesToInts
public static int[] bytesToInts(byte[] bytes) -
intToBytes
public static byte[] intToBytes(int n) -
longToBytes
public static byte[] longToBytes(long n) -
bytesToInt
public static int bytesToInt(byte[] bytes) -
bytesToLong
public static long bytesToLong(byte[] bytes) -
bytesToLong
-
bytesToInt
-
blockingRead
- Throws:
IOException
-
blockingRead
public static ByteBuffer blockingRead(SocketChannel so, long timeout, byte[] bytes) throws IOException - Throws:
IOException
-