org.apache.sanselan.common
Class BinaryOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.apache.sanselan.common.BinaryOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, BinaryConstants

public class BinaryOutputStream
extends java.io.OutputStream
implements BinaryConstants


Field Summary
protected  boolean debug
           
 
Fields inherited from interface org.apache.sanselan.common.BinaryConstants
BYTE_ORDER_BIG_ENDIAN, BYTE_ORDER_INTEL, BYTE_ORDER_LEAST_SIGNIFICANT_BYTE, BYTE_ORDER_LITTLE_ENDIAN, BYTE_ORDER_LSB, BYTE_ORDER_MOST_SIGNIFICANT_BYTE, BYTE_ORDER_MOTOROLA, BYTE_ORDER_MSB, BYTE_ORDER_NETWORK
 
Constructor Summary
BinaryOutputStream(java.io.OutputStream os)
           
BinaryOutputStream(java.io.OutputStream os, int byteOrder)
           
 
Method Summary
 int getByteCount()
           
 int getByteOrder()
           
 boolean getDebug()
           
protected  void setByteOrder(int byteOrder)
           
protected  void setByteOrder(int a, int b)
           
 void setDebug(boolean b)
           
 void write(int i)
           
 void write2ByteInteger(int value)
           
 void write2Bytes(int value)
           
 void write3Bytes(int value)
           
 void write4ByteInteger(int value)
           
 void write4Bytes(int value)
           
 void writeByteArray(byte[] bytes)
           
 
Methods inherited from class java.io.OutputStream
close, flush, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected boolean debug
Constructor Detail

BinaryOutputStream

public BinaryOutputStream(java.io.OutputStream os,
                          int byteOrder)

BinaryOutputStream

public BinaryOutputStream(java.io.OutputStream os)
Method Detail

setDebug

public final void setDebug(boolean b)

getDebug

public final boolean getDebug()

setByteOrder

protected void setByteOrder(int a,
                            int b)
                     throws ImageWriteException,
                            java.io.IOException
Throws:
ImageWriteException
java.io.IOException

setByteOrder

protected void setByteOrder(int byteOrder)

getByteOrder

public int getByteOrder()

write

public void write(int i)
           throws java.io.IOException
Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException

getByteCount

public int getByteCount()

write4Bytes

public final void write4Bytes(int value)
                       throws ImageWriteException,
                              java.io.IOException
Throws:
ImageWriteException
java.io.IOException

write3Bytes

public final void write3Bytes(int value)
                       throws ImageWriteException,
                              java.io.IOException
Throws:
ImageWriteException
java.io.IOException

write2Bytes

public final void write2Bytes(int value)
                       throws ImageWriteException,
                              java.io.IOException
Throws:
ImageWriteException
java.io.IOException

write4ByteInteger

public final void write4ByteInteger(int value)
                             throws ImageWriteException,
                                    java.io.IOException
Throws:
ImageWriteException
java.io.IOException

write2ByteInteger

public final void write2ByteInteger(int value)
                             throws ImageWriteException,
                                    java.io.IOException
Throws:
ImageWriteException
java.io.IOException

writeByteArray

public final void writeByteArray(byte[] bytes)
                          throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2007-2009. All Rights Reserved.