Package com.pnfsoftware.jeb.util.io
Class ChannelUtil
java.lang.Object
com.pnfsoftware.jeb.util.io.ChannelUtil
Utility methods for
Channels, in particular, SeekableByteChannels.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byteget(SeekableByteChannel channel) static byteget(SeekableByteChannel channel, long position) static byte[]getAllFrom(SeekableByteChannel channel, long position) static intgetBEInt(SeekableByteChannel channel) static intgetBEInt(SeekableByteChannel channel, long position) static longgetBELong(SeekableByteChannel channel) static longgetBELong(SeekableByteChannel channel, long position) static shortgetBEShort(SeekableByteChannel channel) static shortgetBEShort(SeekableByteChannel channel, long position) static byte[]getBytes(SeekableByteChannel channel, int size) static byte[]getBytes(SeekableByteChannel channel, long position, int size) static byte[]getBytesUntil(SeekableByteChannel channel, int stopper, int maxsize, boolean throwOnEOS) static intgetInt(SeekableByteChannel channel, long position, ByteOrder endianness) static intgetInt(SeekableByteChannel channel, ByteOrder endianness) static intgetLEInt(SeekableByteChannel channel) static intgetLEInt(SeekableByteChannel channel, long position) static longgetLELong(SeekableByteChannel channel) static longgetLELong(SeekableByteChannel channel, long position) static shortgetLEShort(SeekableByteChannel channel) static shortgetLEShort(SeekableByteChannel channel, long position) static longgetLong(SeekableByteChannel channel, long position, ByteOrder endianness) static longgetLong(SeekableByteChannel channel, ByteOrder endianness) static shortgetShort(SeekableByteChannel channel, long position, ByteOrder endianness) static shortgetShort(SeekableByteChannel channel, ByteOrder endianness) static ByteBufferread(SeekableByteChannel channel, long position, int size, boolean isBigEndian) static ByteBufferread(SeekableByteChannel channel, long position, int size, boolean isBigEndian, ByteBuffer buffer) static ByteBufferreadBestEffort(SeekableByteChannel channel, long position, int size, boolean isBigEndian, ByteBuffer buffer)
-
Constructor Details
-
ChannelUtil
public ChannelUtil()
-
-
Method Details
-
read
public static ByteBuffer read(SeekableByteChannel channel, long position, int size, boolean isBigEndian) throws IOException - Throws:
IOException
-
read
public static ByteBuffer read(SeekableByteChannel channel, long position, int size, boolean isBigEndian, ByteBuffer buffer) throws IOException - Throws:
IOException
-
readBestEffort
public static ByteBuffer readBestEffort(SeekableByteChannel channel, long position, int size, boolean isBigEndian, ByteBuffer buffer) throws IOException - Throws:
IOException
-
getAllFrom
- Throws:
IOException
-
get
- Throws:
IOException
-
get
- Throws:
IOException
-
getBytes
public static byte[] getBytes(SeekableByteChannel channel, long position, int size) throws IOException - Throws:
IOException
-
getBytes
- Throws:
IOException
-
getShort
public static short getShort(SeekableByteChannel channel, long position, ByteOrder endianness) throws IOException - Throws:
IOException
-
getInt
public static int getInt(SeekableByteChannel channel, long position, ByteOrder endianness) throws IOException - Throws:
IOException
-
getLong
public static long getLong(SeekableByteChannel channel, long position, ByteOrder endianness) throws IOException - Throws:
IOException
-
getShort
- Throws:
IOException
-
getInt
- Throws:
IOException
-
getLong
- Throws:
IOException
-
getLEShort
- Throws:
IOException
-
getLEInt
- Throws:
IOException
-
getLELong
- Throws:
IOException
-
getBEShort
- Throws:
IOException
-
getBEInt
- Throws:
IOException
-
getBELong
- Throws:
IOException
-
getLEShort
- Throws:
IOException
-
getLEInt
- Throws:
IOException
-
getLELong
- Throws:
IOException
-
getBEShort
- Throws:
IOException
-
getBEInt
- Throws:
IOException
-
getBELong
- Throws:
IOException
-
getBytesUntil
public static byte[] getBytesUntil(SeekableByteChannel channel, int stopper, int maxsize, boolean throwOnEOS) throws IOException - Throws:
IOException
-