Package com.peterphi.std.io.nio
Class NIOHelper
java.lang.Object
com.peterphi.std.io.nio.NIOHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteBufferblockingRead(SocketChannel so, long timeout, byte[] bytes) static ByteBufferblockingRead(SocketChannel so, long timeout, int bytes) static intbytesToInt(byte[] bytes) static intstatic int[]bytesToInts(byte[] bytes) static longbytesToLong(byte[] bytes) static longstatic 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
-