org.extex.backend.documentWriter.dvi
Class DviOutputStream

java.lang.Object
  extended by org.extex.backend.documentWriter.dvi.DviOutputStream

public class DviOutputStream
extends java.lang.Object

This class provides the methods to write to the dvi-Stream.

Version:
$Revision:4704 $
Author:
Sebastian Waschik

Constructor Summary
DviOutputStream(java.io.OutputStream theOutputStream)
          Creates a new instance.
 
Method Summary
 void close()
          ...
 int getStreamPosition()
          Get the StreamPosition value.
 void writeByte(int theByte)
          Writes a single byte to the output stream.
 void writeCodeNumberAndArg(int[] codes, int argNumber)
          Write a value and the dvi code to the output stream.
 void writeCodeNumberAndArg(int[] shortCodes, int[] codes, int argNumber)
          Write a command with an number as argument.
 void writeNumber(int number, int bytes)
          Write a number to the output stream.
 void writeString(java.lang.String string)
          Write a string to the output stream.
 void writeStringAndSize(java.lang.String string)
          Write a string to the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DviOutputStream

public DviOutputStream(java.io.OutputStream theOutputStream)
Creates a new instance.

Parameters:
theOutputStream - OutputStream for dvi file
Method Detail

close

public void close()
           throws GeneralException,
                  java.io.IOException
...

Throws:
GeneralException - ...
java.io.IOException - ...

getStreamPosition

public int getStreamPosition()
Get the StreamPosition value.

Returns:
the StreamPosition value.

writeByte

public void writeByte(int theByte)
               throws GeneralException
Writes a single byte to the output stream.

Parameters:
theByte - the output
Throws:
GeneralException - if an error occurs

writeNumber

public void writeNumber(int number,
                        int bytes)
                 throws GeneralException
Write a number to the output stream.

Parameters:
number - the number
bytes - the number of bytes for the number
Throws:
GeneralException - if an error occurs

writeString

public void writeString(java.lang.String string)
                 throws GeneralException
Write a string to the output stream.

Parameters:
string - the string
Throws:
GeneralException - if an error occurs

writeStringAndSize

public void writeStringAndSize(java.lang.String string)
                        throws GeneralException
Write a string to the output stream. Before the string the number of characters is written.

Parameters:
string - the string
Throws:
GeneralException - if an error occurs

writeCodeNumberAndArg

public void writeCodeNumberAndArg(int[] codes,
                                  int argNumber)
                           throws GeneralException
Write a value and the dvi code to the output stream. The code depends on the number.

Parameters:
codes - codes for one, two, ... long argument
argNumber - the number for writing
Throws:
GeneralException - if an error occurs
See Also:
"TTP [610]"

writeCodeNumberAndArg

public void writeCodeNumberAndArg(int[] shortCodes,
                                  int[] codes,
                                  int argNumber)
                           throws GeneralException
Write a command with an number as argument.

Parameters:
shortCodes - codes for numbers including the argument
codes - codes for longer arguments
argNumber - the argument
Throws:
GeneralException - if an error occurs