| Package | Description |
|---|---|
| net.lecousin.framework.application |
Main classes to initialize this library: LCCore and Application.
|
| net.lecousin.framework.application.launcher |
Application launcher.
|
| net.lecousin.framework.application.libraries |
Library loading and management.
|
| net.lecousin.framework.application.libraries.artifacts |
Libraries management using group id, artifact id and version.
|
| net.lecousin.framework.application.libraries.classloader |
Class loaders when libraries are loaded dynamically.
|
| net.lecousin.framework.application.libraries.classpath |
Default implementation of LibrariesManager, simply using the classpath of the JVM.
|
| net.lecousin.framework.concurrent.tasks |
Implementations of tasks.
|
| 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.encoding |
Utility classes for encoding.
|
| 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.serialization |
Serialization and deserialization framework.
|
| net.lecousin.framework.io.text |
IO on characters and text.
|
| net.lecousin.framework.io.util |
Utility classes for IO.
|
| net.lecousin.framework.locale |
Localization.
|
| net.lecousin.framework.plugins |
Plugins mechanism.
|
| net.lecousin.framework.xml |
XML Parsing and generation.
|
| net.lecousin.framework.xml.serialization |
XML serialization and deserialization.
|
| Modifier and Type | Method and Description |
|---|---|
IO.Readable |
Application.getResource(String filename,
byte priority)
Get a resource from the class loader as an IO.Readable.
|
| Modifier and Type | Method and Description |
|---|---|
IO.Readable |
DynamicLibrariesManager.getResource(String path,
byte priority) |
IO.Readable |
DynamicLibrariesManager.getResource(String groupId,
String artifactId,
String path,
byte priority) |
IO.Readable |
DynamicLibrariesManager.getResourceFrom(ClassLoader cl,
String path,
byte priority)
Open a resource from the given class loader.
|
| Modifier and Type | Method and Description |
|---|---|
IO.Readable |
LibrariesManager.getResource(String path,
byte priority)
Open a resource or return null if it does not exist.
|
| Modifier and Type | Method and Description |
|---|---|
IO.Readable |
ArtifactsLibrariesManager.getResource(String groupId,
String artifactId,
String path,
byte priority)
Open a resource from a specific library if possible, or return null if it does not exist.
|
| Modifier and Type | Method and Description |
|---|---|
IO.Readable |
AppClassLoader.getResourceIO(String name,
byte priority)
Load a resource.
|
IO.Readable |
ZipClassLoader.loadResourceAsIO(String name,
byte priority) |
IO.Readable |
DirectoryClassLoader.loadResourceAsIO(String name,
byte priority) |
protected abstract IO.Readable |
AbstractClassLoader.loadResourceAsIO(String name,
byte priority)
Load a resource as IO.Readable.
|
IO.Readable |
AbstractClassLoader.open(String path,
byte priority)
Open a resource.
|
protected IO.Readable |
ZipClassLoader.openResourcePointer(Object pointer,
byte priority) |
protected IO.Readable |
DirectoryClassLoader.openResourcePointer(Object pointer,
byte priority) |
protected abstract IO.Readable |
AbstractClassLoader.openResourcePointer(Object pointer,
byte priority) |
| Modifier and Type | Method and Description |
|---|---|
IO.Readable |
DefaultLibrariesManager.getResource(String path,
byte priority) |
| Modifier and Type | Method and Description |
|---|---|
static AsyncSupplier<Properties,Exception> |
LoadPropertiesFileTask.loadPropertiesFile(IO.Readable input,
Charset charset,
byte priority,
IO.OperationType closeInputAtEnd,
Consumer<Properties> onDone)
Load properties from a Readable IO.
|
| Modifier and Type | Interface and Description |
|---|---|
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.Readable.Buffered
Indicates the IO is buffered, and add operations.
|
static interface |
IO.Readable.Seekable
Add read operations to read at a specific position.
|
| 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.
|
class |
IOFromInputStream
Implements Readable from an InputStream.
|
static class |
IOFromInputStream.KnownSize
Add the capability to get the size to IOFromInputStream.
|
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.
|
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.
|
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.
|
| Modifier and Type | Method and Description |
|---|---|
static <T extends IO.Readable & IO.KnownSize> |
IOUtil.readFullyKnownSize(T io,
AsyncSupplier<byte[],IOException> result)
Read fully into a byte[], and unblock the given result upon completion.
|
| Modifier and Type | Method and Description |
|---|---|
static AsyncSupplier<Long,IOException> |
IOUtil.copy(IO.Readable input,
IO.Writable output,
long size,
boolean closeIOs,
WorkProgress progress,
long work)
Copy from a Readable to a Writable.
|
static InputStream |
IOAsInputStream.get(IO.Readable io,
boolean closeAsync)
Get an instance for the given IO.
|
static Task<Integer,IOException> |
IOUtil.readAsyncUsingSync(IO.Readable io,
ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone)
Implement an asynchronous read using a task calling the synchronous one.
|
static void |
IOUtil.readFully(IO.Readable io,
AsyncSupplier<byte[],IOException> result)
Read fully into a byte[], and unblock the given result upon completion.
|
static int |
IOUtil.readFully(IO.Readable io,
ByteBuffer buffer)
Fill the remaining bytes of the given buffer.
|
static AsyncSupplier<UnprotectedStringBuffer,IOException> |
IOUtil.readFullyAsString(IO.Readable io,
Charset charset,
byte priority)
Read all bytes from the given Readable and convert it as a String using the given charset encoding.
|
static String |
IOUtil.readFullyAsStringSync(IO.Readable io,
Charset charset)
Read all bytes from the given Readable and convert it as a String using the given charset encoding.
|
static void |
IOUtil.readFullyAsStringSync(IO.Readable io,
Charset charset,
StringBuilder s)
Read all bytes from the given Readable and append them to the given StringBuilder using the given charset encoding.
|
static AsyncSupplier<Integer,IOException> |
IOUtil.readFullyAsync(IO.Readable io,
ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone)
Fill the remaining bytes of the given buffer asynchronously.
|
static AsyncSupplier<Integer,IOException> |
IOUtil.readFullyAsync(IO.Readable io,
ByteBuffer buffer,
int done,
Consumer<Pair<Integer,IOException>> ondone)
Fill the remaining bytes of the given buffer asynchronously.
|
static AsyncSupplier<ByteBuffersIO,IOException> |
IOUtil.readFullyAsync(IO.Readable io,
int bufferSize)
Read the content of IO.Readable in memory and put it into a ByteBuffersIO.
|
static Task<Integer,IOException> |
IOUtil.readFullyAsyncUsingSync(IO.Readable io,
ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone)
Implement an asynchronous read using a task calling the synchronous one.
|
static void |
IOUtil.readFullyKnownSize(IO.Readable io,
int size,
AsyncSupplier<byte[],IOException> result)
Read fully into a byte[], and unblock the given result upon completion.
|
static int |
IOUtil.readFullySyncUsingAsync(IO.Readable io,
ByteBuffer buffer)
Implement a synchronous read using an asynchronous one and blocking until it finishes.
|
static int |
IOUtil.readSyncUsingAsync(IO.Readable io,
ByteBuffer buffer)
Implement a synchronous read using an asynchronous one and blocking until it finishes.
|
static AsyncSupplier<Long,IOException> |
IOUtil.skipAsyncByReading(IO.Readable io,
long n,
Consumer<Pair<Long,IOException>> ondone)
Implement an asynchronous skip using readAsync.
|
static AsyncSupplier<Long,IOException> |
IOUtil.skipAsyncUsingSync(IO.Readable io,
long n,
Consumer<Pair<Long,IOException>> ondone)
Implement an asynchronous skip using a task calling a synchronous skip.
|
static long |
IOUtil.skipSyncByReading(IO.Readable io,
long n)
Implement a synchronous skip using a synchronous read.
|
static long |
IOUtil.skipSyncUsingAsync(IO.Readable io,
long n)
Implement a synchronous skip using an asynchronous one and blocking until it finishes.
|
static AsyncSupplier<File,IOException> |
IOUtil.toTempFile(IO.Readable io)
Write the given Readable to a temporary file, and return the temporary file.
|
| Constructor and Description |
|---|
DeterminedSize(String description,
IO.Readable... ios)
Constructor.
|
Readable(IO.Readable io)
Constructor.
|
Readable(IO.Readable io,
long position)
Constructor with initial position.
|
Readable(IO.Readable src,
long size,
String description,
boolean closeSrcOnClose)
Constructor.
|
Readable(String description,
IO.Readable... 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 |
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 |
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 | 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 |
|---|
DeterminedSize(IO.Readable io,
int firstBuffer,
int secondBuffer)
Constructor.
|
PreBufferedReadable(IO.Readable src,
int firstBuffer,
byte firstBufferPriority,
int nextBuffer,
byte nextBufferPriority,
int maxNbNextBuffersReady)
Constructor.
|
PreBufferedReadable(IO.Readable src,
long size,
int firstBuffer,
byte firstBufferPriority,
int nextBuffer,
byte nextBufferPriority,
int maxNbNextBuffersReady)
Constructor.
|
ReadableToSeekable(IO.Readable io,
int bufferSize)
Constructor.
|
SimpleBufferedReadable(IO.Readable io,
int bufferSize)
Constructor.
|
SingleBufferReadable(IO.Readable io,
int bufferSize,
boolean useReadFully)
Constructor.
|
TwoBuffersIO(IO.Readable io,
int firstBuffer,
int secondBuffer)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static IAsync<IOException> |
Base64.encodeAsync(IO.Readable io,
ICharacterStream.WriterAsync writer)
Encode the Readable IO into the Writer.
|
static IAsync<IOException> |
Base64.encodeAsync(IO.Readable io,
IO.WriterAsync writer)
Encode the Readable IO into the Writer.
|
| 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 | Method and Description |
|---|---|
<T extends IO.Readable & IO.KnownSize> |
IOProvider.Readable.KnownSize.provideIOReadableKnownSize(byte priority)
Provide a IO.Readable with KnownSize.
|
default <T extends IO.Readable & IO.KnownSize> |
IOProvider.Readable.Seekable.KnownSize.provideIOReadableKnownSize(byte priority) |
default <T extends IO.Readable & IO.KnownSize> |
IOProvider.ReadWrite.KnownSize.provideIOReadableKnownSize(byte priority) |
default <T extends IO.Readable & IO.KnownSize> |
IOProvider.ReadWrite.Seekable.KnownSize.provideIOReadableKnownSize(byte priority) |
<T extends IO.Readable & IO.Writable> |
IOProvider.ReadWrite.provideIOReadWrite(byte priority)
Provider a IO Readable and Writable.
|
default <T extends IO.Readable & IO.Writable> |
IOProvider.ReadWrite.KnownSize.provideIOReadWrite(byte priority) |
default <T extends IO.Readable & IO.Writable> |
IOProvider.ReadWrite.Seekable.provideIOReadWrite(byte priority) |
default <T extends IO.Readable & IO.Writable> |
IOProvider.ReadWrite.Seekable.KnownSize.provideIOReadWrite(byte priority) |
<T extends IO.Readable & IO.Writable & IO.KnownSize> |
IOProvider.ReadWrite.KnownSize.provideIOReadWriteKnownSize(byte priority) |
default <T extends IO.Readable & IO.Writable & IO.KnownSize> |
IOProvider.ReadWrite.KnownSize.Resizable.provideIOReadWriteKnownSize(byte priority) |
default <T extends IO.Readable & IO.Writable & IO.KnownSize> |
IOProvider.ReadWrite.Seekable.KnownSize.provideIOReadWriteKnownSize(byte priority) |
default <T extends IO.Readable & IO.Writable & IO.KnownSize> |
IOProvider.ReadWrite.Seekable.KnownSize.Resizable.provideIOReadWriteKnownSize(byte priority) |
<T extends IO.Readable & IO.Writable & IO.Resizable> |
IOProvider.ReadWrite.KnownSize.Resizable.provideIOReadWriteResizable(byte priority) |
default <T extends IO.Readable & IO.Writable & IO.Resizable> |
IOProvider.ReadWrite.Seekable.KnownSize.Resizable.provideIOReadWriteResizable(byte priority) |
| Modifier and Type | Method and Description |
|---|---|
IO.Readable |
IOProvider.Readable.provideIOReadable(byte priority)
Provide a IO.Readable.
|
default IO.Readable |
IOProvider.Readable.KnownSize.provideIOReadable(byte priority) |
default IO.Readable |
IOProvider.Readable.Seekable.provideIOReadable(byte priority) |
default IO.Readable |
IOProvider.Readable.Seekable.KnownSize.provideIOReadable(byte priority) |
default IO.Readable |
IOProvider.ReadWrite.provideIOReadable(byte priority) |
default IO.Readable |
IOProvider.ReadWrite.KnownSize.provideIOReadable(byte priority) |
default IO.Readable |
IOProvider.ReadWrite.Seekable.provideIOReadable(byte priority) |
default IO.Readable |
IOProvider.ReadWrite.Seekable.KnownSize.provideIOReadable(byte priority) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract AsyncSupplier<IO.Readable,SerializationException> |
AbstractDeserializer.deserializeIOReadableAttributeValue(SerializationContext.AttributeContext context,
List<SerializationRule> rules) |
protected abstract AsyncSupplier<IO.Readable,SerializationException> |
AbstractDeserializer.deserializeIOReadableValue(SerializationContext context,
List<SerializationRule> rules) |
AsyncSupplier<IO.Readable,SerializationException> |
Deserializer.StreamReferenceHandler.getStreamFromReference(String text)
Retrieve the stream from the given reference.
|
| Modifier and Type | Method and Description |
|---|---|
<T> AsyncSupplier<T,SerializationException> |
Deserializer.deserialize(TypeDefinition type,
IO.Readable input,
List<SerializationRule> rules)
Deserialize an object/value of the given type from the given input.
|
<T> AsyncSupplier<T,SerializationException> |
AbstractDeserializer.deserialize(TypeDefinition type,
IO.Readable input,
List<SerializationRule> rules) |
protected abstract IAsync<SerializationException> |
AbstractDeserializer.initializeDeserialization(IO.Readable input) |
protected abstract IAsync<SerializationException> |
AbstractSerializer.serializeIOReadableAttribute(SerializationContext.AttributeContext context,
IO.Readable io,
String path,
List<SerializationRule> rules) |
protected abstract IAsync<SerializationException> |
AbstractSerializer.serializeIOReadableValue(SerializationContext context,
IO.Readable io,
String path,
List<SerializationRule> rules) |
| Constructor and Description |
|---|
BufferedReadableCharacterStream(IO.Readable input,
CharsetDecoder decoder,
int bufferSize,
int maxBuffers)
Constructor.
|
BufferedReadableCharacterStream(IO.Readable input,
CharsetDecoder decoder,
int bufferSize,
int maxBuffers,
ByteBuffer initBytes,
CharBuffer initChars)
Constructor.
|
BufferedReadableCharacterStream(IO.Readable input,
Charset charset,
int bufferSize,
int maxBuffers)
Constructor.
|
BufferedReadableCharacterStream(IO.Readable input,
Charset charset,
int bufferSize,
int maxBuffers,
ByteBuffer initBytes,
CharBuffer initChars)
Constructor.
|
| Modifier and Type | Class and Description |
|---|---|
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.
|
| Constructor and Description |
|---|
IOReaderAsProducer(IO.Readable io,
int bufferSize)
Constructor.
|
NonBufferedReadableIOAsBuffered(IO.Readable io)
Constructor.
|
ReadableAsURLConnection(IO.Readable io,
URL url,
boolean closeAsync)
Constructor.
|
ReadableWithProgress(IO.Readable io,
long size,
WorkProgress progress,
long work)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends ClassLoader & ApplicationClassLoader> |
LocaleExtensionPoint.loadPluginConfiguration(IO.Readable io,
T classLoader,
IAsync<?>... startOn) |
| Modifier and Type | Method and Description |
|---|---|
default <T extends ClassLoader & ApplicationClassLoader> |
CustomExtensionPoint.loadPluginConfiguration(IO.Readable io,
T libraryClassLoader,
IAsync<?>... startOn)
Load configuration.
|
| Constructor and Description |
|---|
XMLStreamReader(IO.Readable io,
Charset defaultEncoding,
int charactersBuffersSize,
int maxBuffers)
Initialize with the given IO.
|
XMLStreamReader(IO.Readable io,
int charactersBuffersSize,
int maxBuffers)
Constructor, without charset.
|
XMLStreamReaderAsync(IO.Readable io,
Charset defaultEncoding,
int charactersBuffersSize,
int maxBuffers)
Initialize with the given IO.
|
XMLStreamReaderAsync(IO.Readable io,
int charactersBuffersSize,
int maxBuffers)
Constructor, without charset (automatic detection).
|
| Modifier and Type | Method and Description |
|---|---|
protected AsyncSupplier<IO.Readable,SerializationException> |
XMLDeserializer.deserializeIOReadableAttributeValue(SerializationContext.AttributeContext context,
List<SerializationRule> rules) |
protected AsyncSupplier<IO.Readable,SerializationException> |
XMLDeserializer.deserializeIOReadableValue(SerializationContext context,
List<SerializationRule> rules) |
| Modifier and Type | Method and Description |
|---|---|
protected IAsync<Exception> |
XMLDeserializer.createAndStartReader(IO.Readable input) |
static <T> AsyncSupplier<T,SerializationException> |
XMLDeserializer.deserialize(IO.Readable input,
Class<T> type,
List<SerializationRule> rules)
Deserialize from a IO.Readable.
|
protected IAsync<SerializationException> |
XMLDeserializer.initializeDeserialization(IO.Readable input) |
protected IAsync<SerializationException> |
XMLSerializer.serializeIOReadableAttribute(SerializationContext.AttributeContext context,
IO.Readable io,
String path,
List<SerializationRule> rules) |
protected IAsync<SerializationException> |
XMLSerializer.serializeIOReadableValue(SerializationContext context,
IO.Readable io,
String path,
List<SerializationRule> rules) |
Copyright © 2019. All rights reserved.