Class RTFImageOutputStream
java.lang.Object
java.io.OutputStream
com.nomagic.magicreport.engine.rtf.RTFImageOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
The RTF image output stream.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe number of WMF header length. -
Constructor Summary
ConstructorsConstructorDescriptionRTFImageOutputStream(Writer writer, String imageType) Create RTF image output stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this output stream and releases any system resources associated with this stream.longReturn total characters has been written.voidwrite(byte[] b, int off, int len) Writeslenbytes from the specified byte array starting at offsetoffto this byte RTF image output stream.voidwrite(int b) Writes the specified byte to this RTF image output stream.protected voidwriteHex(byte b) Write hexadecimal string.Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
Field Details
-
WMF_PLACEABLE_HEADER_SIZE
public static final int WMF_PLACEABLE_HEADER_SIZEThe number of WMF header length.- See Also:
-
-
Constructor Details
-
RTFImageOutputStream
Create RTF image output stream.- Parameters:
writer- the stream to write the converted imageimageType- target image type
-
-
Method Details
-
writeHex
Write hexadecimal string.- Parameters:
b- a byte- Throws:
IOException- when IO error occurred
-
write
Writes the specified byte to this RTF image output stream.- Specified by:
writein classOutputStream- Parameters:
b- the byte to be written.- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the output stream has been closed.
-
write
Writeslenbytes from the specified byte array starting at offsetoffto this byte RTF image output stream.- Overrides:
writein classOutputStream- Parameters:
b- the data.off- the start offset in the data.len- the number of bytes to write.- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the output stream has been closed.
-
getTotalWrittenChars
public long getTotalWrittenChars()Return total characters has been written.- Returns:
- the total written characters
-
close
Closes this output stream and releases any system resources associated with this stream. A closed stream cannot perform output operations and cannot be reopened.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException- if an I/O error occurs.
-