public final class

OutputStreamAdapter

extends OutputStream
java.lang.Object
   ↳ java.io.OutputStream
     ↳ com.pspdfkit.document.providers.OutputStreamAdapter

Class Overview

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 OutputStreamAdapter.Builder.

Summary

Nested Classes
class OutputStreamAdapter.Builder Creates instances of the OutputStreamAdapter
Public Methods
void close()
void finishWritingToDataProvider()
Call this from your WritingStrategy once your done writing all data using writeToDataProvider(byte[])
void write(byte[] data)
void write(int data)
void writeToDataProvider(byte[] data)
Call this from your WritingStrategy to actually write to the WritableDataProvider.
[Expand]
Inherited Methods
From class java.io.OutputStream
From class java.lang.Object
From interface java.io.Closeable
From interface java.io.Flushable
From interface java.lang.AutoCloseable

Public Methods

public void close ()

Throws
IOException

public void finishWritingToDataProvider ()

Call this from your WritingStrategy once your done writing all data using writeToDataProvider(byte[])

Throws
IOException If there was a problem writing to the data provider.

public void write (byte[] data)

Throws
IOException

public void write (int data)

Throws
IOException

public void writeToDataProvider (byte[] data)

Call this from your WritingStrategy to actually write to the WritableDataProvider.

Parameters
data The data to write.
Throws
IOException If there was a problem writing to the data provider.