Package com.pspdfkit.document.providers
Class OutputStreamAdapter
-
- All Implemented Interfaces:
-
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public final class OutputStreamAdapter extends OutputStream
The OutputStreamAdapter allows you to use a WritableDataProvider in APIs that expect an OutputStream. This uses a WritingStrategy to control how the data is passed over to the WritableDataProvider. Obtain an instance using the Builder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
OutputStreamAdapter.Builder
Creates instances of the OutputStreamAdapter.
-
Method Summary
Modifier and Type Method Description void
write(int data)
void
write(@NonNull() Array<byte> data)
void
close()
void
writeToDataProvider(Array<byte> data)
Call this from your WritingStrategy to actually write to the . void
finishWritingToDataProvider()
Call this from your WritingStrategy once your done writing all data using writeToDataProvider -
-
Method Detail
-
write
void write(int data)
-
close
void close()
-
writeToDataProvider
void writeToDataProvider(Array<byte> data)
Call this from your WritingStrategy to actually write to the .
- Parameters:
data
- The data to write.
-
finishWritingToDataProvider
void finishWritingToDataProvider()
Call this from your WritingStrategy once your done writing all data using writeToDataProvider
-
-
-
-