Class Stream
java.lang.Object
java.io.OutputStream
de.erichseifert.vectorgraphics2d.pdf.Stream
- All Implemented Interfaces:
PDFObject
,Closeable
,Flushable
,AutoCloseable
Represents a stream object in the sense of the PDF specification.
The
Stream
has a defined length.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final ByteArrayOutputStream
private OutputStream
private final List
<Stream.Filter> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
Field Details
-
data
-
filters
-
filteredData
-
closed
private boolean closed
-
-
Constructor Details
-
Stream
Initializes a newStream
.
-
-
Method Details
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
Appends the specified byte array to theStream
.- Overrides:
write
in classOutputStream
- Parameters:
data
- Data to be appended.- Throws:
IOException
-
getLength
public int getLength()Returns the size of the stream contents in bytes.- Returns:
- Number of bytes.
- Throws:
IllegalStateException
- if the stream is still open.
-
getContent
public byte[] getContent()Returns the content that has been written to thisStream
.- Returns:
- Stream content.
- Throws:
IllegalStateException
- if the stream is still open.
-
isClosed
private boolean isClosed() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
-
getFilters
-