| Package | Description |
|---|---|
| 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.text |
IO on characters and text.
|
| net.lecousin.framework.io.util |
Utility classes for IO.
|
| net.lecousin.framework.memory |
Memory management, caches...
|
| net.lecousin.framework.util |
Utility classes.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
IO
Base interface for all IO, see the package documentation
net.lecousin.framework.io. |
static interface |
IO.KnownSize
Add capability to know the size of an IO.
|
static interface |
IO.OutputToInput
An OutputToInput is an IO on which a producer is writing, and a consumer is reading.
The producer receive it as a Writable, and the consumer as a Readable. Both can work concurrently: as soon as data is written by the producer, it can be read by the consumer. The producer must call the method endOfData or signalErrorBeforeEndOfData, so the consumer can receive the information it reaches the end of the IO. The implementations may add additional capabilities such as Readable.Seekable if it keeps the data. |
static interface |
IO.PositionKnown
Capability to get the current position on an IO.
|
static interface |
IO.Readable
Add the capability to read forward on an IO.
|
static interface |
IO.Readable.Buffered
Indicates the IO is buffered, and add operations.
|
static interface |
IO.Readable.Seekable
Add read operations to read at a specific position.
|
static interface |
IO.ReadableByteStream
Add capability to read byte by byte, typically a buffered IO.
|
static interface |
IO.Resizable
Add capability to resize the IO.
|
static interface |
IO.Seekable
Capability to set the position on an IO.
|
static interface |
IO.Writable
Add the capability to write forward on an IO.
|
static interface |
IO.Writable.Buffered
Add a flush operation to force writing on the underlying IO.
|
static interface |
IO.Writable.Seekable
Add operations to write at a specific position.
|
static interface |
IO.WritableByteStream
Add capability to write byte by byte.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractIO
Utility class as a base for IO implementations.
|
class |
FileIO
IO on a file, using one of the 3 sub-classes: FileIO.ReadOnly, FileIO.WriteOnly, FileIO.ReadWrite.
|
static class |
FileIO.ReadOnly
FileIO in read-only mode.
|
static class |
FileIO.ReadWrite
FileIO with read and write operations.
|
static class |
FileIO.WriteOnly
FileIO in write-only mode.
|
class |
FragmentedSubIO
A fragmented sub-IO allows to specify a list of fragments inside a seekable IO, and does like those fragments are a contiguous IO.
|
static class |
FragmentedSubIO.Readable
Readable fragmented IO.
|
static class |
FragmentedSubIO.ReadWrite
Readable and Writable fragmented IO.
|
class |
IOFromInputStream
Implements Readable from an InputStream.
|
static class |
IOFromInputStream.KnownSize
Add the capability to get the size to IOFromInputStream.
|
class |
IOFromOutputStream
Implements Writable from an OutputStream.
|
class |
LinkedIO
Make several IOs as a single one.
|
static class |
LinkedIO.Readable
Linked Readable IO.
|
static class |
LinkedIO.Readable.Buffered
Linked Readable Buffered IO.
|
static class |
LinkedIO.Readable.Buffered.DeterminedSize
Linked Readable Buffered IO and add the DeterminedSize capability.
|
static class |
LinkedIO.Readable.DeterminedSize
Linked Readable IO and add the DeterminedSize capability.
|
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.
|
class |
PositionKnownWrapper<IOType extends IO>
Add the capability to known on which position we are on an IO.
|
static class |
PositionKnownWrapper.Readable
Add the capability to known on which position we are on a Readable.
|
static class |
PositionKnownWrapper.Readable.Buffered
Add the capability to known on which position we are on a Buffered Readable.
|
class |
SubIO
Sub-part of an IO.
|
static class |
SubIO.Readable
Sub-part of a Readable 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.
|
static class |
SubIO.Writable
Sub-part of a Writable IO.
|
static class |
SubIO.Writable.Seekable
Sub-part of a Seekable Writable IO.
|
| 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 |
BufferedReverseIOReading
IO that can read bytes backward.
|
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 |
PreBufferedReadable
Often the best implementation when reading sequentially (streaming, without seek): it fills a first buffer
as soon as instantiated, once the first buffer is filled new buffers are pre-filled.
|
class |
ReadableToSeekable
Convert a Readable into a Seekable.
|
class |
SimpleBufferedReadable
This implementation of buffered readable IO use a simple buffering strategy, with 2 buffers:
while the first one is used, the second is filled in background.
|
class |
SimpleBufferedWritable
Simple implementation of a buffered writable using 2 buffers.
The first buffer is first filled with written data. |
class |
SingleBufferReadable
This is the less efficient buffered readable implementation: it uses a single buffer, which is filled only when first byte
is read (and so is blocking).
|
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 | Class and Description |
|---|---|
class |
OutputToInput
Implementation of IO.OutputToInput using the given IO.
|
class |
OutputToInputBuffers
Implementation of IO.OutputToInput using a list of ByteBuffer, that are stored in memory while
writing, and removed while reading them.
Optionally a maximum number of pending buffers can be specified. |
| Modifier and Type | Interface and Description |
|---|---|
interface |
ICharacterStream
Character stream.
|
static interface |
ICharacterStream.Readable
Readable character stream.
|
static interface |
ICharacterStream.Readable.Buffered
Buffered readable character stream.
|
static interface |
ICharacterStream.Readable.PositionInText
Readable character stream with known line and position in line.
|
static interface |
ICharacterStream.Writable
Writable character stream.
|
static interface |
ICharacterStream.Writable.Buffered
Buffered writable character stream.
|
| Modifier and Type | Class and Description |
|---|---|
class |
BufferedReadableCharacterStream
Implement a buffered readable character stream from a readable IO.
|
class |
BufferedReadableCharacterStreamLocation
Buffered readable character stream that calculate the line number and position on the current line while reading.
|
class |
BufferedWritableCharacterStream
Implement a buffered writable character stream from a writable IO.
|
class |
ProgressiveBufferedReadableCharStream
Buffered readable character stream.
|
class |
TextLineStream
Allow to read a text file line by line.
|
class |
WritableCharacterStream
Implement a non-buffered writable character stream using a writable IO.
|
| Modifier and Type | Class and Description |
|---|---|
class |
BroadcastIO
Aggregation of several IOs, every write is performed on all IOs.
|
class |
EmptyReadable
Implement an empty Readable IO, with Buffered, Seekable and KnownSize capabilities.
|
class |
NonBufferedReadableIOAsBuffered
Utility class to implement the Buffered interface even in case buffers cannot be used.
|
class |
ReadableSeekableToDeterminedSize
Add the KnownSize capability: to determine the size, we can seek to the end and get the position.
|
class |
ReadableWithProgress
Wraps an IO.Readable and make a WorkProgress progress while data is read on it.
|
| Modifier and Type | Method and Description |
|---|---|
void |
ReadableSeekableToDeterminedSize.addCloseListener(Consumer<CloseableListenable> listener) |
void |
ReadableSeekableToDeterminedSize.removeCloseListener(Consumer<CloseableListenable> listener) |
| Modifier and Type | Method and Description |
|---|---|
void |
Cache.free(Value value,
CloseableListenable user)
Signal that the given cached data is not anymore used by the given user.
|
Value |
Cache.get(Key key,
CloseableListenable user)
Return the cached data corresponding to the given key, or null if it does not exist.
|
void |
Cache.put(Key key,
Value value,
CloseableListenable firstUser)
Add the given data to this cache, and add the given first user to it.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
IConcurrentCloseable<TError extends Exception>
A closeable resource having asynchronous operations.
|
| Modifier and Type | Class and Description |
|---|---|
static class |
CloseableListenable.Impl
Default implementation to handle listeners fired on close.
|
class |
ConcurrentCloseable<TError extends Exception>
Implement most of the functionalities expected by an IConcurrentCloseable.
|
protected class |
UnprotectedStringBuffer.AbstractCS
Base class for CharacterStream implementations.
|
protected class |
UnprotectedStringBuffer.CS
CharacterStream implementation.
|
protected class |
UnprotectedStringBuffer.WCS
CharacterStream implementation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
ConcurrentCloseable.addCloseListener(Consumer<CloseableListenable> listener) |
void |
CloseableListenable.addCloseListener(Consumer<CloseableListenable> listener)
Add a listener to be called once this resource is closed.
|
void |
CloseableListenable.Impl.addCloseListener(Consumer<CloseableListenable> listener) |
void |
ConcurrentCloseable.removeCloseListener(Consumer<CloseableListenable> listener) |
void |
CloseableListenable.removeCloseListener(Consumer<CloseableListenable> listener)
Remove a listener.
|
void |
CloseableListenable.Impl.removeCloseListener(Consumer<CloseableListenable> listener) |
Copyright © 2019. All rights reserved.