Class FSTOutputStream

java.lang.Object
java.io.OutputStream
org.nustaq.serialization.util.FSTOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

public final class FSTOutputStream
extends java.io.OutputStream
Created with IntelliJ IDEA. User: ruedi Date: 19.11.12 Time: 10:00 To change this template use File | Settings | File Templates.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    byte[] buf
    The buffer where data is stored.
    int pos
    The number of valid bytes in the buffer.
  • Constructor Summary

    Constructors 
    Constructor Description
    FSTOutputStream​(int size, java.io.OutputStream out)  
    FSTOutputStream​(java.io.OutputStream out)  
  • Method Summary

    Modifier and Type Method Description
    void close()  
    void copyTo​(java.io.OutputStream out)
    only works if no flush has been triggered (aka only write one object per stream instance)
    void ensureCapacity​(int minCapacity)  
    void ensureFree​(int free)  
    void flush()  
    byte[] getBuf()  
    int getOff()  
    java.io.OutputStream getOutstream()  
    void reset()  
    void reset​(byte[] out)  
    void setBuf​(byte[] buf)  
    void setOutstream​(java.io.OutputStream outstream)  
    int size()  
    byte[] toByteArray()  
    void write​(byte[] b, int off, int len)  
    void write​(int b)  

    Methods inherited from class java.io.OutputStream

    nullOutputStream, write

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • buf

      public byte[] buf
      The buffer where data is stored.
    • pos

      public int pos
      The number of valid bytes in the buffer.
  • Constructor Details

    • FSTOutputStream

      public FSTOutputStream​(java.io.OutputStream out)
    • FSTOutputStream

      public FSTOutputStream​(int size, java.io.OutputStream out)
  • Method Details

    • getOutstream

      public java.io.OutputStream getOutstream()
    • setOutstream

      public void setOutstream​(java.io.OutputStream outstream)
    • getBuf

      public byte[] getBuf()
    • setBuf

      public void setBuf​(byte[] buf)
    • ensureFree

      public final void ensureFree​(int free) throws java.io.IOException
      Throws:
      java.io.IOException
    • ensureCapacity

      public final void ensureCapacity​(int minCapacity) throws java.io.IOException
      Throws:
      java.io.IOException
    • write

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

      public void write​(byte[] b, int off, int len) throws java.io.IOException
      Overrides:
      write in class java.io.OutputStream
      Throws:
      java.io.IOException
    • copyTo

      public void copyTo​(java.io.OutputStream out) throws java.io.IOException
      only works if no flush has been triggered (aka only write one object per stream instance)
      Parameters:
      out -
      Throws:
      java.io.IOException
    • reset

      public void reset()
    • toByteArray

      public byte[] toByteArray()
    • size

      public int size()
    • close

      public void close() throws java.io.IOException
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable
      Overrides:
      close in class java.io.OutputStream
      Throws:
      java.io.IOException
    • flush

      public void flush() throws java.io.IOException
      Specified by:
      flush in interface java.io.Flushable
      Overrides:
      flush in class java.io.OutputStream
      Throws:
      java.io.IOException
    • reset

      public void reset​(byte[] out)
    • getOff

      public int getOff()