Class Stream
- java.lang.Object
-
- java.io.OutputStream
-
- de.erichseifert.vectorgraphics2d.pdf.Stream
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Stream.Filter
-
Field Summary
Fields Modifier and Type Field Description private boolean
closed
private java.io.ByteArrayOutputStream
data
private java.io.OutputStream
filteredData
private 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 void
close()
byte[]
getContent()
Returns the content that has been written to thisStream
.java.util.List<Stream.Filter>
getFilters()
int
getLength()
Returns the size of the stream contents in bytes.private boolean
isClosed()
void
write(byte[] data)
Appends the specified byte array to theStream
.void
write(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:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] data) throws java.io.IOException
Appends the specified byte array to theStream
.- Overrides:
write
in 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.OutputStream
-
getFilters
public java.util.List<Stream.Filter> getFilters()
-
-