org.jcodec.common
Class NIOUtils
java.lang.Object
org.jcodec.common.NIOUtils
public class NIOUtils
- extends Object
This class is part of JCodec ( www.jcodec.org ) This software is distributed
under FreeBSD License
- Author:
- Jay Codec
|
Method Summary |
static AutoFileChannelWrapper |
autoChannel(File file)
|
static void |
closeQuietly(ReadableByteChannel channel)
|
static ByteBuffer |
combine(ByteBuffer... buffer)
|
static ByteBuffer |
combine(Iterable<ByteBuffer> picture)
|
static void |
copy(ReadableByteChannel in,
WritableByteChannel out,
long amount)
|
static ByteBuffer |
fetchFrom(File file)
|
static ByteBuffer |
fetchFrom(File file,
int length)
|
static ByteBuffer |
fetchFrom(ReadableByteChannel ch,
int size)
|
static void |
fill(ByteBuffer buffer,
byte val)
|
static ByteBuffer |
from(ByteBuffer buffer,
int offset)
|
static MappedByteBuffer |
map(File file)
|
static MappedByteBuffer |
map(String fileName)
|
static ByteBuffer |
read(ByteBuffer buffer)
|
static ByteBuffer |
read(ByteBuffer buffer,
int count)
|
static int |
read(ReadableByteChannel channel,
ByteBuffer buffer)
|
static int |
read(ReadableByteChannel channel,
ByteBuffer buffer,
int length)
|
static FileChannelWrapper |
readableFileChannel(File file)
|
static FileChannelWrapper |
readableFileChannel(String file)
|
static byte |
readByte(ReadableByteChannel channel)
|
static int |
readInt(ReadableByteChannel channel)
|
static int |
readInt(ReadableByteChannel channel,
ByteOrder order)
|
static byte[] |
readNByte(ReadableByteChannel channel,
int n)
|
static String |
readNullTermString(ByteBuffer buffer)
|
static String |
readNullTermString(ByteBuffer buffer,
Charset charset)
|
static String |
readPascalString(ByteBuffer buffer)
|
static String |
readPascalString(ByteBuffer buffer,
int maxLen)
|
static String |
readString(ByteBuffer buffer,
int len)
|
static FileChannelWrapper |
rwFileChannel(File file)
|
static FileChannelWrapper |
rwFileChannel(String file)
|
static ByteBuffer |
search(ByteBuffer buffer,
int n,
byte... param)
|
static int |
skip(ByteBuffer buffer,
int count)
|
static byte[] |
toArray(ByteBuffer buffer)
|
static byte[] |
toArray(ByteBuffer buffer,
int count)
|
static FileChannelWrapper |
writableFileChannel(File file)
|
static FileChannelWrapper |
writableFileChannel(String file)
|
static void |
write(ByteBuffer to,
ByteBuffer from)
|
static void |
write(ByteBuffer to,
ByteBuffer from,
int count)
|
static void |
writeByte(WritableByteChannel channel,
byte value)
|
static void |
writeInt(WritableByteChannel channel,
int value)
|
static void |
writeInt(WritableByteChannel channel,
int value,
ByteOrder order)
|
static void |
writeLong(WritableByteChannel channel,
long value)
|
static void |
writePascalString(ByteBuffer buffer,
String name)
|
static void |
writePascalString(ByteBuffer buffer,
String string,
int maxLen)
|
static void |
writeTo(ByteBuffer buffer,
File file)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NIOUtils
public NIOUtils()
search
public static ByteBuffer search(ByteBuffer buffer,
int n,
byte... param)
read
public static final ByteBuffer read(ByteBuffer buffer,
int count)
fetchFrom
public static ByteBuffer fetchFrom(File file)
throws IOException
- Throws:
IOException
fetchFrom
public static ByteBuffer fetchFrom(ReadableByteChannel ch,
int size)
throws IOException
- Throws:
IOException
fetchFrom
public static ByteBuffer fetchFrom(File file,
int length)
throws IOException
- Throws:
IOException
writeTo
public static void writeTo(ByteBuffer buffer,
File file)
throws IOException
- Throws:
IOException
toArray
public static byte[] toArray(ByteBuffer buffer)
toArray
public static byte[] toArray(ByteBuffer buffer,
int count)
read
public static int read(ReadableByteChannel channel,
ByteBuffer buffer,
int length)
throws IOException
- Throws:
IOException
read
public static int read(ReadableByteChannel channel,
ByteBuffer buffer)
throws IOException
- Throws:
IOException
write
public static void write(ByteBuffer to,
ByteBuffer from)
write
public static void write(ByteBuffer to,
ByteBuffer from,
int count)
fill
public static void fill(ByteBuffer buffer,
byte val)
map
public static final MappedByteBuffer map(String fileName)
throws IOException
- Throws:
IOException
map
public static final MappedByteBuffer map(File file)
throws IOException
- Throws:
IOException
skip
public static int skip(ByteBuffer buffer,
int count)
from
public static ByteBuffer from(ByteBuffer buffer,
int offset)
combine
public static ByteBuffer combine(Iterable<ByteBuffer> picture)
combine
public static ByteBuffer combine(ByteBuffer... buffer)
readString
public static String readString(ByteBuffer buffer,
int len)
readPascalString
public static String readPascalString(ByteBuffer buffer,
int maxLen)
writePascalString
public static void writePascalString(ByteBuffer buffer,
String string,
int maxLen)
writePascalString
public static void writePascalString(ByteBuffer buffer,
String name)
readPascalString
public static String readPascalString(ByteBuffer buffer)
readNullTermString
public static String readNullTermString(ByteBuffer buffer)
readNullTermString
public static String readNullTermString(ByteBuffer buffer,
Charset charset)
read
public static ByteBuffer read(ByteBuffer buffer)
copy
public static void copy(ReadableByteChannel in,
WritableByteChannel out,
long amount)
throws IOException
- Throws:
IOException
closeQuietly
public static void closeQuietly(ReadableByteChannel channel)
readByte
public static byte readByte(ReadableByteChannel channel)
throws IOException
- Throws:
IOException
readNByte
public static byte[] readNByte(ReadableByteChannel channel,
int n)
throws IOException
- Throws:
IOException
readInt
public static int readInt(ReadableByteChannel channel)
throws IOException
- Throws:
IOException
readInt
public static int readInt(ReadableByteChannel channel,
ByteOrder order)
throws IOException
- Throws:
IOException
writeByte
public static void writeByte(WritableByteChannel channel,
byte value)
throws IOException
- Throws:
IOException
writeInt
public static void writeInt(WritableByteChannel channel,
int value,
ByteOrder order)
throws IOException
- Throws:
IOException
writeInt
public static void writeInt(WritableByteChannel channel,
int value)
throws IOException
- Throws:
IOException
writeLong
public static void writeLong(WritableByteChannel channel,
long value)
throws IOException
- Throws:
IOException
readableFileChannel
public static FileChannelWrapper readableFileChannel(File file)
throws FileNotFoundException
- Throws:
FileNotFoundException
writableFileChannel
public static FileChannelWrapper writableFileChannel(File file)
throws FileNotFoundException
- Throws:
FileNotFoundException
rwFileChannel
public static FileChannelWrapper rwFileChannel(File file)
throws FileNotFoundException
- Throws:
FileNotFoundException
readableFileChannel
public static FileChannelWrapper readableFileChannel(String file)
throws FileNotFoundException
- Throws:
FileNotFoundException
writableFileChannel
public static FileChannelWrapper writableFileChannel(String file)
throws FileNotFoundException
- Throws:
FileNotFoundException
rwFileChannel
public static FileChannelWrapper rwFileChannel(String file)
throws FileNotFoundException
- Throws:
FileNotFoundException
autoChannel
public static AutoFileChannelWrapper autoChannel(File file)
throws IOException
- Throws:
IOException
Copyright © 2013. All Rights Reserved.