Class BufferedVolumeEmbosser
- java.lang.Object
-
- org.daisy.braille.utils.impl.tools.embosser.AbstractEmbosserWriter
-
- org.daisy.braille.utils.impl.tools.embosser.BufferedVolumeEmbosser
-
- All Implemented Interfaces:
Closeable,AutoCloseable,EmbosserWriter,EmbosserWriterProperties
public class BufferedVolumeEmbosser extends AbstractEmbosserWriter
Provides a buffered volume embossers. This is similar toConfigurableEmbosser, except that it supports writing each volume separately to a PrinterDevice rather than to an OutputStream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBufferedVolumeEmbosser.BuilderProvides a builder for a BufferedVolumeEmbosser.-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAll(byte[] bytes)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.voidnewVolumeSectionAndPage(boolean duplex)Starts a new page on a blank sheet of paper in a new volume with the specified duplex settings.voidopen(boolean duplex)Opens for writing using the default contract.-
Methods inherited from class org.daisy.braille.utils.impl.tools.embosser.AbstractEmbosserWriter
currentPage, getMaxWidth, getPagebreakStyle, getRowGap, init, isClosed, isOpen, lineFeed, newLine, newPage, newSectionAndPage, pageIsEmpty, setRowGap, supportsAligning, write
-
-
-
-
Method Detail
-
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
-
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.
-
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
-
addAll
protected void addAll(byte[] bytes)
Description copied from class:AbstractEmbosserWriterAdds bytes to the EmbosserWriter output.- Specified by:
addAllin classAbstractEmbosserWriter- Parameters:
bytes- the bytes to add
-
formFeed
protected void formFeed() throws IOExceptionDescription copied from class:AbstractEmbosserWriterPerforms a form feed on the EmbosserWriter.- Overrides:
formFeedin classAbstractEmbosserWriter- Throws:
IOException- if IO fails
-
newVolumeSectionAndPage
public void newVolumeSectionAndPage(boolean duplex) throws IOExceptionDescription copied from interface:EmbosserWriterStarts a new page on a blank sheet of paper in a new volume with the specified duplex settings.- Specified by:
newVolumeSectionAndPagein interfaceEmbosserWriter- Overrides:
newVolumeSectionAndPagein classAbstractEmbosserWriter- Parameters:
duplex- 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
-
-