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 theByteWriterFactorythat always constructsByteArrayByteWriterinstances.
-
-
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 voidcloseByteWriter(ByteWriter byteWriter)The caller has finished with the givenByteWriterand will no longer use it again.voidcloseFactory()TheByteWriterFactoryis 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 arrayByteWriterinstances with the given properties.ByteWritergetByteWriter(ByteWriterFactory.Longevity longevity, ByteWriterFactory.EncryptionStatus encryption, ByteWriterFactory.Fixed fixed, long size, boolean fast)Request a singleByteWriterwith 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:ByteWriterFactoryRequest a singleByteWriterwith 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 ofByteWriterto return. These should be viewed as "advice" to the implementation about the intended usage.- Specified by:
getByteWriterin interfaceByteWriterFactory- Parameters:
longevity- anticipated lifetime of theByteWriterencryption- encryption status of the data to be placed into theByteWriterfixed- whether the size given is the maximum data that will ever be placed into theByteWritersize- either the maximum size of the data or an estimate of the size depending on the value of thefixedparameterfast- the requestedByteWriterneeds to be fast- Returns:
- a
ByteWritermatching 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:ByteWriterFactoryRequest an arrayByteWriterinstances 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 ofByteWriterto return. These should be viewed as "advice" to the implementation about the intended usage.- Specified by:
getByteWriterin interfaceByteWriterFactory- Parameters:
longevity- anticipated lifetime of theByteWriterencyrption- encryption status of the data to be placed into theByteWriterfixed- whether the size given is the maximum data that will ever be placed into theByteWritersize- either the maximum size of the data or an estimate of the size depending on the value of thefixedparameterfast- the requestedByteWriterneeds to be fast- Returns:
- a
ByteWritermatching 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:ByteWriterFactoryThe caller has finished with the givenByteWriterand will no longer use it again. The implementation can close it.- Specified by:
closeByteWriterin 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.IOExceptionDescription copied from interface:ByteWriterFactoryTheByteWriterFactoryis no longer needed and it should close down and free all resources allocated. AllByteWriterinstances created by this factory can and may be destroyed during this process.- Specified by:
closeFactoryin interfaceByteWriterFactory- Throws:
java.io.IOException- See Also:
ByteWriterFactory.closeFactory()
-
-