org.hsqldb.lib
Class HsqlByteArrayOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.hsqldb.lib.HsqlByteArrayOutputStream
All Implemented Interfaces:
DataOutput
Direct Known Subclasses:
RowOutputBase

public class HsqlByteArrayOutputStream
extends OutputStream
implements DataOutput

This class is a replacement for both java.io.ByteArrayOuputStream (without synchronization) and java.io.DataOutputStream

Version:
1.7.2
Author:
fredt@users

Field Summary
protected  byte[] buf
           
protected  int count
           
 
Constructor Summary
HsqlByteArrayOutputStream()
           
HsqlByteArrayOutputStream(byte[] buffer)
           
HsqlByteArrayOutputStream(int size)
           
 
Method Summary
 void close()
           
protected  void ensureRoom(int extra)
           
 void fill(int b, int len)
           
 void flush()
          does nothing
 byte[] getBuffer()
           
 void reset()
           
protected  void reset(int newSize)
           
 int size()
           
 byte[] toByteArray()
           
 String toString()
           
 String toString(int hibyte)
           
 String toString(String enc)
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 void writeBoolean(boolean v)
           
 void writeByte(int v)
           
 void writeBytes(String s)
           
 void writeChar(int v)
           
 void writeChars(String s)
           
 void writeDouble(double v)
           
 void writeFloat(float v)
           
 void writeInt(int v)
           
 void writeLong(long v)
           
 void writeShort(int v)
           
 void writeTo(OutputStream out)
           
 void writeUTF(String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

buf

protected byte[] buf

count

protected int count
Constructor Detail

HsqlByteArrayOutputStream

public HsqlByteArrayOutputStream()

HsqlByteArrayOutputStream

public HsqlByteArrayOutputStream(int size)

HsqlByteArrayOutputStream

public HsqlByteArrayOutputStream(byte[] buffer)
Method Detail

writeShort

public final void writeShort(int v)
Specified by:
writeShort in interface DataOutput

writeInt

public final void writeInt(int v)
Specified by:
writeInt in interface DataOutput

writeLong

public final void writeLong(long v)
Specified by:
writeLong in interface DataOutput

writeBytes

public final void writeBytes(String s)
Specified by:
writeBytes in interface DataOutput

writeFloat

public final void writeFloat(float v)
Specified by:
writeFloat in interface DataOutput

writeDouble

public final void writeDouble(double v)
Specified by:
writeDouble in interface DataOutput

writeBoolean

public void writeBoolean(boolean v)
                  throws IOException
Specified by:
writeBoolean in interface DataOutput
Throws:
IOException

writeByte

public void writeByte(int v)
               throws IOException
Specified by:
writeByte in interface DataOutput
Throws:
IOException

writeChar

public void writeChar(int v)
               throws IOException
Specified by:
writeChar in interface DataOutput
Throws:
IOException

writeChars

public void writeChars(String s)
                throws IOException
Specified by:
writeChars in interface DataOutput
Throws:
IOException

writeUTF

public void writeUTF(String str)
              throws IOException
Specified by:
writeUTF in interface DataOutput
Throws:
IOException

flush

public void flush()
           throws IOException
does nothing

Throws:
IOException

write

public void write(int b)
Specified by:
write in interface DataOutput

write

public void write(byte[] b)
           throws IOException
Specified by:
write in interface DataOutput
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
Specified by:
write in interface DataOutput

writeTo

public void writeTo(OutputStream out)
             throws IOException
Throws:
IOException

reset

public void reset()

toByteArray

public byte[] toByteArray()

size

public int size()

toString

public String toString()

toString

public String toString(String enc)
                throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

toString

public String toString(int hibyte)

close

public void close()
           throws IOException
Throws:
IOException

fill

public void fill(int b,
                 int len)

getBuffer

public byte[] getBuffer()

ensureRoom

protected void ensureRoom(int extra)

reset

protected void reset(int newSize)


Copyright © 2001 - 2004 HSQL Development Group. All Rights Reserved.