Package org.mp4parser.tools
Class ByteBufferByteChannel
- java.lang.Object
-
- org.mp4parser.tools.ByteBufferByteChannel
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,ReadableByteChannel,WritableByteChannel
public class ByteBufferByteChannel extends Object implements ByteChannel
Creates aReadableByteChannelthat is backed by aByteBuffer.
-
-
Constructor Summary
Constructors Constructor Description ByteBufferByteChannel(byte[] byteArray)ByteBufferByteChannel(ByteBuffer byteBuffer)
-
-
-
Constructor Detail
-
ByteBufferByteChannel
public ByteBufferByteChannel(byte[] byteArray)
-
ByteBufferByteChannel
public ByteBufferByteChannel(ByteBuffer byteBuffer)
-
-
Method Detail
-
read
public int read(ByteBuffer dst) throws IOException
- Specified by:
readin interfaceReadableByteChannel- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
write
public int write(ByteBuffer src) throws IOException
- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-
-