rice.p2p.util.rawserialization
Class SizeChecker

java.lang.Object
  extended by rice.p2p.util.rawserialization.SizeChecker
All Implemented Interfaces:
OutputBuffer, SizeCheckOutputBuffer
Direct Known Subclasses:
DirectSizeChecker

public abstract class SizeChecker
extends Object
implements SizeCheckOutputBuffer


Field Summary
protected  int count
           
 
Constructor Summary
SizeChecker()
           
 
Method Summary
 int bytesRemaining()
           
 int bytesWritten()
           
 void write(byte[] b, int off, int len)
           
 void writeBoolean(boolean v)
           
 void writeByte(byte v)
           
 void writeChar(char v)
           
 void writeDouble(double v)
           
 void writeFloat(float v)
           
 void writeInt(int v)
           
 void writeLong(long v)
           
 void writeShort(short v)
           
abstract  void writeSpecial(Object o)
          Increment count appropriately
 void writeUTF(String str)
          This is bogus if you aren't using ascii!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

count

protected int count
Constructor Detail

SizeChecker

public SizeChecker()
Method Detail

writeSpecial

public abstract void writeSpecial(Object o)
                           throws IOException
Increment count appropriately

Specified by:
writeSpecial in interface SizeCheckOutputBuffer
Throws:
IOException

bytesWritten

public int bytesWritten()
Specified by:
bytesWritten in interface SizeCheckOutputBuffer

bytesRemaining

public int bytesRemaining()
Specified by:
bytesRemaining in interface OutputBuffer

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Specified by:
write in interface OutputBuffer
Throws:
IOException

writeBoolean

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

writeByte

public void writeByte(byte v)
               throws IOException
Specified by:
writeByte in interface OutputBuffer
Throws:
IOException

writeChar

public void writeChar(char v)
               throws IOException
Specified by:
writeChar in interface OutputBuffer
Throws:
IOException

writeDouble

public void writeDouble(double v)
                 throws IOException
Specified by:
writeDouble in interface OutputBuffer
Throws:
IOException

writeFloat

public void writeFloat(float v)
                throws IOException
Specified by:
writeFloat in interface OutputBuffer
Throws:
IOException

writeInt

public void writeInt(int v)
              throws IOException
Specified by:
writeInt in interface OutputBuffer
Throws:
IOException

writeLong

public void writeLong(long v)
               throws IOException
Specified by:
writeLong in interface OutputBuffer
Throws:
IOException

writeShort

public void writeShort(short v)
                throws IOException
Specified by:
writeShort in interface OutputBuffer
Throws:
IOException

writeUTF

public void writeUTF(String str)
              throws IOException
This is bogus if you aren't using ascii! Would need to do more introspection.

Specified by:
writeUTF in interface OutputBuffer
Throws:
IOException


Copyright © 2010. All Rights Reserved.