Class FileUtils.ByteBufferBackedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- io.github.lukehutch.fastclasspathscanner.utils.FileUtils.ByteBufferBackedInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- FileUtils
public static class FileUtils.ByteBufferBackedInputStream extends InputStream
InputStream for backed by a ByteBuffer. From: https://stackoverflow.com/questions/4332264/wrapping-a-bytebuffer-with-an-inputstream/6603018#6603018 Don't forget to close or release the ByteBuffer when the InputStream is closed, if needed.
-
-
Constructor Summary
Constructors Constructor Description ByteBufferBackedInputStream(ByteBuffer buf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
read()
int
read(byte[] bytes, int off, int len)
-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, readAllBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
ByteBufferBackedInputStream
public ByteBufferBackedInputStream(ByteBuffer buf)
-
-
Method Detail
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] bytes, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
-