Class Stream
- java.lang.Object
-
- java.io.OutputStream
-
- de.erichseifert.vectorgraphics2d.pdf.Stream
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStream.Filter
-
Field Summary
Fields Modifier and Type Field Description private booleanclosedprivate java.io.ByteArrayOutputStreamdataprivate java.io.OutputStreamfilteredDataprivate java.util.List<Stream.Filter>filters
-
Constructor Summary
Constructors Constructor Description Stream(Stream.Filter... filters)Initializes a newStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()byte[]getContent()Returns the content that has been written to thisStream.java.util.List<Stream.Filter>getFilters()intgetLength()Returns the size of the stream contents in bytes.private booleanisClosed()voidwrite(byte[] data)Appends the specified byte array to theStream.voidwrite(int b)
-
-
-
Field Detail
-
data
private final java.io.ByteArrayOutputStream data
-
filters
private final java.util.List<Stream.Filter> filters
-
filteredData
private java.io.OutputStream filteredData
-
closed
private boolean closed
-
-
Constructor Detail
-
Stream
public Stream(Stream.Filter... filters)
Initializes a newStream.
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] data) throws java.io.IOExceptionAppends the specified byte array to theStream.- Overrides:
writein classjava.io.OutputStream- Parameters:
data- Data to be appended.- Throws:
java.io.IOException
-
getLength
public int getLength()
Returns the size of the stream contents in bytes.- Returns:
- Number of bytes.
- Throws:
java.lang.IllegalStateException- if the stream is still open.
-
getContent
public byte[] getContent()
Returns the content that has been written to thisStream.- Returns:
- Stream content.
- Throws:
java.lang.IllegalStateException- if the stream is still open.
-
isClosed
private boolean isClosed()
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream
-
getFilters
public java.util.List<Stream.Filter> getFilters()
-
-