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 void
addAll(byte[] b)
Adds bytes to the EmbosserWriter output.void
close()
protected void
formFeed()
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.LineBreaks
getLinebreakStyle()
Gets the line break style for the EmbosserWriter.AbstractEmbosserWriter.Padding
getPaddingStyle()
Gets the form feed padding style for the EmbosserWriter.protected void
lineFeed()
Performs a line feed on the EmbosserWriter.void
newLine()
Starts a new line.void
open(boolean duplex)
Opens for writing using the default contract.void
write(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:AbstractEmbosserWriter
Gets the line break style for the EmbosserWriter.- Specified by:
getLinebreakStyle
in classAbstractEmbosserWriter
- Returns:
- returns the line break style for the EmbosserWriter
-
getPaddingStyle
public AbstractEmbosserWriter.Padding getPaddingStyle()
Description copied from class:AbstractEmbosserWriter
Gets the form feed padding style for the EmbosserWriter.- Specified by:
getPaddingStyle
in classAbstractEmbosserWriter
- Returns:
- returns the padding style for the EmbosserWriter
-
getBytes
public byte[] getBytes(String braille) throws UnsupportedEncodingException
Description copied from class:AbstractEmbosserWriter
Translates a string of braille into bytes that should be transfered to the embosser.- Specified by:
getBytes
in 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 IOException
Description copied from class:AbstractEmbosserWriter
Adds bytes to the EmbosserWriter output.- Specified by:
addAll
in classAbstractEmbosserWriter
- Parameters:
b
- the bytes to add- Throws:
IOException
- if IO fails
-
newLine
public void newLine() throws IOException
Description copied from interface:EmbosserWriter
Starts a new line.- Specified by:
newLine
in interfaceEmbosserWriter
- Overrides:
newLine
in classAbstractEmbosserWriter
- Throws:
IOException
- if an I/O error occurs
-
lineFeed
protected void lineFeed() throws IOException
Description copied from class:AbstractEmbosserWriter
Performs a line feed on the EmbosserWriter.- Overrides:
lineFeed
in classAbstractEmbosserWriter
- Throws:
IOException
- if IO fails
-
formFeed
protected void formFeed() throws IOException
Description copied from class:AbstractEmbosserWriter
Performs a form feed on the EmbosserWriter.- Overrides:
formFeed
in classAbstractEmbosserWriter
- Throws:
IOException
- if IO fails
-
write
public void write(String braille) throws IOException
Description copied from interface:EmbosserWriter
Writes 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:
write
in interfaceEmbosserWriter
- Overrides:
write
in 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 IOException
Description copied from interface:EmbosserWriter
Opens for writing using the default contract.- Specified by:
open
in interfaceEmbosserWriter
- Overrides:
open
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classAbstractEmbosserWriter
- Throws:
IOException
-
-