| Package | Description |
|---|---|
| net.lecousin.framework.adapter |
Adapters can obtain an instance of a type from another type.
|
| net.lecousin.framework.io |
New java Input/Output model adding more flexibility and asynchronous operations.
|
| net.lecousin.framework.io.buffering |
IO with bufferization.
|
| net.lecousin.framework.io.out2in |
Implementations of IO.OutputToInput.
|
| net.lecousin.framework.io.provider |
Providers of IO (allow to open IO on demand).
|
| net.lecousin.framework.io.util |
Utility classes for IO.
|
| Modifier and Type | Method and Description |
|---|---|
IO.Readable.Seekable |
FileToIO.Readable.adapt(File input) |
| Modifier and Type | Method and Description |
|---|---|
Class<IO.Readable.Seekable> |
FileToIO.Readable.getOutputType() |
| Modifier and Type | Class and Description |
|---|---|
static class |
FileIO.ReadOnly
FileIO in read-only mode.
|
static class |
FileIO.ReadWrite
FileIO with read and write operations.
|
static class |
FragmentedSubIO.Readable
Readable fragmented IO.
|
static class |
FragmentedSubIO.ReadWrite
Readable and Writable fragmented IO.
|
static class |
LinkedIO.Readable.Seekable
Linked Readable Seekable IO.
|
static class |
LinkedIO.Readable.Seekable.Buffered
Linked Readable, Seekable and Buffered IO.
|
static class |
LinkedIO.Readable.Seekable.Buffered.DeterminedSize
Add the DeterminedSize capability.
|
static class |
LinkedIO.Readable.Seekable.DeterminedSize
Add the DeterminedSize capability.
|
static class |
LinkedIO.ReadWrite
Linked Readable and Writable IO.
|
static class |
SubIO.Readable.Seekable
Sub-part of a Seekable Readable IO.
|
static class |
SubIO.Readable.Seekable.Buffered
Sub-part of a Buffered Seekable Readable IO.
|
static class |
SubIO.ReadWrite
Sub-part of a Seekable Readable and Writable IO.
|
| Modifier and Type | Method and Description |
|---|---|
static <T extends IO.Writable.Seekable & IO.Readable.Seekable> |
IOUtil.copy(T io,
long src,
long dst,
long len)
Copy bytes inside a Seekable IO.
|
| Modifier and Type | Method and Description |
|---|---|
static long |
IOUtil.getSizeSync(IO.Readable.Seekable io)
Get the size by seeking at the end if not an instanceof IO.KnownSize.
|
static Task<Integer,IOException> |
IOUtil.readAsyncUsingSync(IO.Readable.Seekable io,
long pos,
ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone)
Implement an asynchronous read using a task calling the synchronous one.
|
static AsyncSupplier<Integer,IOException> |
IOUtil.readFullyAsync(IO.Readable.Seekable io,
long pos,
ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone)
Fill the remaining bytes of the given buffer.
|
static Task<Integer,IOException> |
IOUtil.readFullyAsyncUsingSync(IO.Readable.Seekable io,
long pos,
ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone)
Implement an asynchronous read using a task calling the synchronous one.
|
static int |
IOUtil.readFullySync(IO.Readable.Seekable io,
long pos,
ByteBuffer buffer)
Fill the remaining bytes of the given buffer.
|
static int |
IOUtil.readFullySyncUsingAsync(IO.Readable.Seekable io,
long pos,
ByteBuffer buffer)
Implement a synchronous read using an asynchronous one and blocking until it finishes.
|
static int |
IOUtil.readSyncUsingAsync(IO.Readable.Seekable io,
long pos,
ByteBuffer buffer)
Implement a synchronous read using an asynchronous one and blocking until it finishes.
|
| Constructor and Description |
|---|
Buffered(String description,
IO.Readable.Seekable... ios)
Constructor.
|
DeterminedSize(String description,
IO.Readable.Seekable... ios)
Constructor.
|
DeterminedSize(String description,
IO.Readable.Seekable... ios)
Constructor.
|
Readable(IO.Readable.Seekable io,
List<RangeLong> fragments,
boolean closeParentIOOnClose,
String description)
Constructor.
|
ReadWrite(String description,
T... ios)
Constructor.
|
Seekable(IO.Readable.Seekable src,
long start,
long size,
String description,
boolean closeSrcOnClose)
Constructor.
|
Seekable(String description,
IO.Readable.Seekable... ios)
Constructor.
|
| Modifier and Type | Class and Description |
|---|---|
class |
BufferedIO
BufferedIO is often the best buffering implementation when we need both bufferization and seek operations.
|
static class |
BufferedIO.ReadWrite
Writable BufferedIO.
|
class |
ByteArrayIO
IO implemented with a single byte array.
|
class |
ByteBuffersIO
Implementation of IO using a list of byte array.
|
class |
IOInMemoryOrFile
Store data first in memory, then if exceeding a given amount of memory, store the remaining
data in a file.
This can be used when the amount of data is not known, and we want to keep good performance with small data (all in memory), but do not allocate too much memory when having large data. A typical usage is when a server is receiving an uploaded file, and the size is not known in advance. This IO is writable and readable: the written data are readable. |
class |
MemoryIO
Implementation of a seekable readable and writable IO, using an array of byte array.
|
class |
ReadableToSeekable
Convert a Readable into a Seekable.
|
class |
TwoBuffersIO
Read an IO.Readable into 2 buffers, then those buffers can be read when ready.
|
static class |
TwoBuffersIO.DeterminedSize
Add DeterminedSize capability.
|
| Modifier and Type | Field and Description |
|---|---|
protected IO.Readable.Seekable |
BufferedIO.io |
| Modifier and Type | Method and Description |
|---|---|
static AsyncSupplier<IO.Readable.Seekable,IOException> |
MemoryIO.from(IO.Readable io)
Create a MemoryIO and fill it with the content of the given Readable.
|
| Constructor and Description |
|---|
BufferedIO(IO.Readable.Seekable io,
int firstBufferSize,
int nextBuffersSize,
boolean preLoadNextBuffer)
Constructor.
|
BufferedIO(IO.Readable.Seekable io,
long size,
int firstBufferSize,
int nextBuffersSize,
boolean preLoadNextBuffer)
Constructor.
|
| Modifier and Type | Class and Description |
|---|---|
class |
OutputToInput
Implementation of IO.OutputToInput using the given IO.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends IO.Readable.Seekable & IO.KnownSize> |
IOProvider.Readable.Seekable.KnownSize.provideIOReadableSeekableKnownSize(byte priority)
Provide a IO.Readable.Seekable with KnownSize.
|
default <T extends IO.Readable.Seekable & IO.KnownSize> |
IOProvider.ReadWrite.Seekable.KnownSize.provideIOReadableSeekableKnownSize(byte priority) |
<T extends IO.Readable.Seekable & IO.KnownSize> |
FileIOProvider.provideIOReadableSeekableKnownSize(byte priority) |
<T extends IO.Readable.Seekable & IO.Writable.Seekable> |
IOProvider.ReadWrite.Seekable.provideIOReadWriteSeekable(byte priority)
Provider a IO Readable.Seekable and Writable.Seekable.
|
default <T extends IO.Readable.Seekable & IO.Writable.Seekable> |
IOProvider.ReadWrite.Seekable.KnownSize.provideIOReadWriteSeekable(byte priority) |
<T extends IO.Readable.Seekable & IO.Writable.Seekable & IO.KnownSize> |
IOProvider.ReadWrite.Seekable.KnownSize.provideIOReadWriteSeekableKnownSize(byte priority) |
default <T extends IO.Readable.Seekable & IO.Writable.Seekable & IO.KnownSize> |
IOProvider.ReadWrite.Seekable.KnownSize.Resizable.provideIOReadWriteSeekableKnownSize(byte priority) |
<T extends IO.Readable.Seekable & IO.Writable.Seekable & IO.KnownSize> |
ByteArrayIOProvider.provideIOReadWriteSeekableKnownSize(byte priority) |
<T extends IO.Readable.Seekable & IO.Writable.Seekable & IO.Resizable> |
IOProvider.ReadWrite.Seekable.KnownSize.Resizable.provideIOReadWriteSeekableResizable(byte priority) |
<T extends IO.Readable.Seekable & IO.Writable.Seekable & IO.Resizable> |
FileIOProvider.provideIOReadWriteSeekableResizable(byte priority) |
| Modifier and Type | Method and Description |
|---|---|
IO.Readable.Seekable |
SubIOProvider.Readable.provideIOReadableSeekable(byte priority) |
IO.Readable.Seekable |
IOProvider.Readable.Seekable.provideIOReadableSeekable(byte priority)
Provide a IO.Readable.Seekable.
|
default IO.Readable.Seekable |
IOProvider.Readable.Seekable.KnownSize.provideIOReadableSeekable(byte priority) |
default IO.Readable.Seekable |
IOProvider.ReadWrite.Seekable.provideIOReadableSeekable(byte priority) |
default IO.Readable.Seekable |
IOProvider.ReadWrite.Seekable.KnownSize.provideIOReadableSeekable(byte priority) |
| Constructor and Description |
|---|
Readable(IO.Readable.Seekable src,
long start,
long size,
String description)
Constructor.
|
| Modifier and Type | Class and Description |
|---|---|
class |
EmptyReadable
Implement an empty Readable IO, with Buffered, Seekable and KnownSize capabilities.
|
class |
ReadableSeekableToDeterminedSize
Add the KnownSize capability: to determine the size, we can seek to the end and get the position.
|
| Constructor and Description |
|---|
ReadableSeekableToDeterminedSize(IO.Readable.Seekable io)
Constructor.
|
Copyright © 2019. All rights reserved.