Class IndexTransparentEmbosserWriter
- java.lang.Object
-
- org.daisy.braille.utils.impl.tools.embosser.AbstractEmbosserWriter
-
- org.daisy.braille.utils.impl.provider.indexbraille.IndexTransparentEmbosserWriter
-
- All Implemented Interfaces:
Closeable,AutoCloseable,EmbosserWriter,EmbosserWriterProperties
public class IndexTransparentEmbosserWriter extends AbstractEmbosserWriter
Provides an embosser writer that uses the transparent mode of index embossers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.daisy.braille.utils.impl.tools.embosser.AbstractEmbosserWriter
AbstractEmbosserWriter.Padding
-
-
Field Summary
-
Fields inherited from class org.daisy.braille.utils.impl.tools.embosser.AbstractEmbosserWriter
pagebreaks, props
-
-
Constructor Summary
Constructors Constructor Description IndexTransparentEmbosserWriter(OutputStream os, byte[] header, byte[] footer, InternalEmbosserWriterProperties props)Creates a new transparent embosser writer using V4/5 transparent mode mapping.IndexTransparentEmbosserWriter(OutputStream os, BrailleConverter bc, boolean eightDot, byte[] header, byte[] footer, InternalEmbosserWriterProperties props)Creates a new transparent embosser writer using the specified braille table.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAll(byte[] b)Adds bytes to the EmbosserWriter output.voidclose()protected voidformFeed()Performs a form feed on the EmbosserWriter.byte[]getBytes(String braille)Translates a string of braille into bytes that should be transfered to the embosser.LineBreaksgetLinebreakStyle()Gets the line break style for the EmbosserWriter.AbstractEmbosserWriter.PaddinggetPaddingStyle()Gets the form feed padding style for the EmbosserWriter.protected voidlineFeed()Performs a line feed on the EmbosserWriter.voidnewLine()Starts a new line.voidopen(boolean duplex)Opens for writing using the default contract.voidwrite(String braille)Writes a string of braille to the embosser.-
Methods inherited from class org.daisy.braille.utils.impl.tools.embosser.AbstractEmbosserWriter
currentPage, getMaxWidth, getPagebreakStyle, getRowGap, init, isClosed, isOpen, newPage, newSectionAndPage, newVolumeSectionAndPage, pageIsEmpty, setRowGap, supportsAligning
-
-
-
-
Constructor Detail
-
IndexTransparentEmbosserWriter
public IndexTransparentEmbosserWriter(OutputStream os, byte[] header, byte[] footer, InternalEmbosserWriterProperties props)
Creates a new transparent embosser writer using V4/5 transparent mode mapping.- Parameters:
os- the output streamheader- the headerfooter- the footerprops- the properties
-
IndexTransparentEmbosserWriter
public IndexTransparentEmbosserWriter(OutputStream os, BrailleConverter bc, boolean eightDot, byte[] header, byte[] footer, InternalEmbosserWriterProperties props)
Creates a new transparent embosser writer using the specified braille table.- Parameters:
os- the output streambc- the braille convertereightDot- true for eight dot transparent mode, false for six dot transparent modeheader- the headerfooter- the footerprops- the properties
-
-
Method Detail
-
getLinebreakStyle
public LineBreaks getLinebreakStyle()
Description copied from class:AbstractEmbosserWriterGets the line break style for the EmbosserWriter.- Specified by:
getLinebreakStylein classAbstractEmbosserWriter- Returns:
- returns the line break style for the EmbosserWriter
-
getPaddingStyle
public AbstractEmbosserWriter.Padding getPaddingStyle()
Description copied from class:AbstractEmbosserWriterGets the form feed padding style for the EmbosserWriter.- Specified by:
getPaddingStylein classAbstractEmbosserWriter- Returns:
- returns the padding style for the EmbosserWriter
-
getBytes
public byte[] getBytes(String braille) throws UnsupportedEncodingException
Description copied from class:AbstractEmbosserWriterTranslates a string of braille into bytes that should be transfered to the embosser.- Specified by:
getBytesin classAbstractEmbosserWriter- Parameters:
braille- the braille (characters in the Braille Patterns unicode block 0x2800-0x28FF).- Returns:
- the bytes
- Throws:
UnsupportedEncodingException- if the string could not be encoded.
-
addAll
protected void addAll(byte[] b) throws IOExceptionDescription copied from class:AbstractEmbosserWriterAdds bytes to the EmbosserWriter output.- Specified by:
addAllin classAbstractEmbosserWriter- Parameters:
b- the bytes to add- Throws:
IOException- if IO fails
-
newLine
public void newLine() throws IOExceptionDescription copied from interface:EmbosserWriterStarts a new line.- Specified by:
newLinein interfaceEmbosserWriter- Overrides:
newLinein classAbstractEmbosserWriter- Throws:
IOException- if an I/O error occurs
-
lineFeed
protected void lineFeed() throws IOExceptionDescription copied from class:AbstractEmbosserWriterPerforms a line feed on the EmbosserWriter.- Overrides:
lineFeedin classAbstractEmbosserWriter- Throws:
IOException- if IO fails
-
formFeed
protected void formFeed() throws IOExceptionDescription copied from class:AbstractEmbosserWriterPerforms a form feed on the EmbosserWriter.- Overrides:
formFeedin classAbstractEmbosserWriter- Throws:
IOException- if IO fails
-
write
public void write(String braille) throws IOException
Description copied from interface:EmbosserWriterWrites a string of braille to the embosser. Values must be between 0x2800 and 0x28FF. An implementation may supply a complete row of braille in a single chunk. However, an implementation may also call this method repeatedly without any other calls in between.- Specified by:
writein interfaceEmbosserWriter- Overrides:
writein classAbstractEmbosserWriter- Parameters:
braille- characters in the range 0x2800 to 0x28FF- Throws:
IOException- if an I/O error occurs
-
open
public void open(boolean duplex) throws IOExceptionDescription copied from interface:EmbosserWriterOpens for writing using the default contract.- Specified by:
openin interfaceEmbosserWriter- Overrides:
openin classAbstractEmbosserWriter- Parameters:
duplex- true if both sides of sheets should be used, false otherwise- Throws:
IOException- if an I/O error occurs
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classAbstractEmbosserWriter- Throws:
IOException
-
-