Package com.adobe.internal.io
Interface ByteWriterFactory
-
- All Known Implementing Classes:
SimpleByteWriterFactory
public interface ByteWriterFactory
Defines a factory for the construction ofByteWriter
instances based on requested parameters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ByteWriterFactory.EncryptionStatus
An enumeration for the encryptioni status of data to placed in a requested instance.static class
ByteWriterFactory.Fixed
An enumeration for the "fixedness" of a requested instance.static class
ByteWriterFactory.Longevity
An enumeration for the anticipated longevity of a requested instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
closeByteWriter(ByteWriter byteWriter)
The caller has finished with the givenByteWriter
and will no longer use it again.void
closeFactory()
TheByteWriterFactory
is no longer needed and it should close down and free all resources allocated.ByteWriter[]
getByteWriter(ByteWriterFactory.Longevity longevity, ByteWriterFactory.EncryptionStatus encryption, ByteWriterFactory.Fixed fixed, long[] size, boolean fast)
Request an arrayByteWriter
instances with the given properties.ByteWriter
getByteWriter(ByteWriterFactory.Longevity longevity, ByteWriterFactory.EncryptionStatus encryption, ByteWriterFactory.Fixed fixed, long size, boolean fast)
Request a singleByteWriter
with the given properties.
-
-
-
Method Detail
-
getByteWriter
ByteWriter getByteWriter(ByteWriterFactory.Longevity longevity, ByteWriterFactory.EncryptionStatus encryption, ByteWriterFactory.Fixed fixed, long size, boolean fast) throws java.io.IOException
Request a singleByteWriter
with the given properties. An implementation is free to ignore the properties or to use them in any way that it views appropriate in choosing the right kind ofByteWriter
to return. These should be viewed as "advice" to the implementation about the intended usage.- Parameters:
longevity
- anticipated lifetime of theByteWriter
encryption
- encryption status of the data to be placed into theByteWriter
fixed
- whether the size given is the maximum data that will ever be placed into theByteWriter
size
- either the maximum size of the data or an estimate of the size depending on the value of thefixed
parameterfast
- the requestedByteWriter
needs to be fast- Returns:
- a
ByteWriter
matching your properties to some degree of "match" - Throws:
java.io.IOException
-
getByteWriter
ByteWriter[] getByteWriter(ByteWriterFactory.Longevity longevity, ByteWriterFactory.EncryptionStatus encryption, ByteWriterFactory.Fixed fixed, long[] size, boolean fast) throws java.io.IOException
Request an arrayByteWriter
instances with the given properties. An implementation is free to ignore the properties or to use them in any way that it views appropriate in choosing the right kind ofByteWriter
to return. These should be viewed as "advice" to the implementation about the intended usage.- Parameters:
longevity
- anticipated lifetime of theByteWriter
encryption
- encryption status of the data to be placed into theByteWriter
fixed
- whether the size given is the maximum data that will ever be placed into theByteWriter
size
- either the maximum size of the data or an estimate of the size depending on the value of thefixed
parameterfast
- the requestedByteWriter
needs to be fast- Returns:
- a
ByteWriter
matching your properties to some degree of "match" - Throws:
java.io.IOException
-
closeByteWriter
void closeByteWriter(ByteWriter byteWriter) throws java.io.IOException
The caller has finished with the givenByteWriter
and will no longer use it again. The implementation can close it.- Parameters:
byteWriter
- a no longer neededByteWriter
- Throws:
java.io.IOException
-
closeFactory
void closeFactory() throws java.io.IOException
TheByteWriterFactory
is no longer needed and it should close down and free all resources allocated. AllByteWriter
instances created by this factory can and may be destroyed during this process.- Throws:
java.io.IOException
-
-