Package com.adobe.internal.io
Class SimpleByteWriterFactory
- java.lang.Object
-
- com.adobe.internal.io.SimpleByteWriterFactory
-
- All Implemented Interfaces:
ByteWriterFactory
public class SimpleByteWriterFactory extends java.lang.Object implements ByteWriterFactory
A simple implementation of theByteWriterFactory
that always constructsByteArrayByteWriter
instances.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.adobe.internal.io.ByteWriterFactory
ByteWriterFactory.EncryptionStatus, ByteWriterFactory.Fixed, ByteWriterFactory.Longevity
-
-
Constructor Summary
Constructors Constructor Description SimpleByteWriterFactory()
-
Method Summary
All Methods Instance Methods Concrete 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 encyrption, 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
public ByteWriter getByteWriter(ByteWriterFactory.Longevity longevity, ByteWriterFactory.EncryptionStatus encryption, ByteWriterFactory.Fixed fixed, long size, boolean fast)
Description copied from interface:ByteWriterFactory
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.- Specified by:
getByteWriter
in interfaceByteWriterFactory
- 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" - See Also:
ByteWriterFactory.getByteWriter(com.adobe.internal.io.ByteWriterFactory.Longevity, com.adobe.internal.io.ByteWriterFactory.EncryptionStatus, com.adobe.internal.io.ByteWriterFactory.Fixed, long, boolean)
-
getByteWriter
public ByteWriter[] getByteWriter(ByteWriterFactory.Longevity longevity, ByteWriterFactory.EncryptionStatus encyrption, ByteWriterFactory.Fixed fixed, long[] size, boolean fast)
Description copied from interface:ByteWriterFactory
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.- Specified by:
getByteWriter
in interfaceByteWriterFactory
- Parameters:
longevity
- anticipated lifetime of theByteWriter
encyrption
- 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" - See Also:
ByteWriterFactory.getByteWriter(com.adobe.internal.io.ByteWriterFactory.Longevity, com.adobe.internal.io.ByteWriterFactory.EncryptionStatus, com.adobe.internal.io.ByteWriterFactory.Fixed, long[], boolean)
-
closeByteWriter
public void closeByteWriter(ByteWriter byteWriter) throws java.io.IOException
Description copied from interface:ByteWriterFactory
The caller has finished with the givenByteWriter
and will no longer use it again. The implementation can close it.- Specified by:
closeByteWriter
in interfaceByteWriterFactory
- Parameters:
byteWriter
- a no longer neededByteWriter
- Throws:
java.io.IOException
- See Also:
ByteWriterFactory.closeByteWriter(com.adobe.internal.io.ByteWriter)
-
closeFactory
public void closeFactory() throws java.io.IOException
Description copied from interface:ByteWriterFactory
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.- Specified by:
closeFactory
in interfaceByteWriterFactory
- Throws:
java.io.IOException
- See Also:
ByteWriterFactory.closeFactory()
-
-