java.lang.Object
java.io.OutputStream
com.orientechnologies.orient.core.serialization.OMemoryStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

@Deprecated public class OMemoryStream extends OutputStream
Deprecated.
use OByteArrayOutputStream instead.
Class to parse and write buffers in very fast way.
Author:
Luca Garulli (l.garulli--(at)--orientdb.com)
  • Field Details

  • Constructor Details

    • OMemoryStream

      public OMemoryStream()
      Deprecated.
    • OMemoryStream

      public OMemoryStream(int initialCapacity)
      Deprecated.
      Callee takes ownership of 'buf'.
    • OMemoryStream

      public OMemoryStream(byte[] stream)
      Deprecated.
  • Method Details

    • move

      public void move(int iFrom, int iPosition)
      Deprecated.
      Move bytes left or right of an offset.
      Parameters:
      iFrom - Starting position
      iPosition - Offset to the iFrom value: positive values mean move right, otherwise move left
    • copyFrom

      public void copyFrom(OMemoryStream iSource, int iSize)
      Deprecated.
    • writeTo

      public final void writeTo(OutputStream out) throws IOException
      Deprecated.
      Throws:
      IOException
    • getInternalBuffer

      public final byte[] getInternalBuffer()
      Deprecated.
    • toByteArray

      public final byte[] toByteArray()
      Deprecated.
      Returns the used buffer as byte[].
      Returns:
      [result.length = size()]
    • reset

      public final void reset()
      Deprecated.
      Does not reduce the current capacity.
    • write

      public final void write(int b)
      Deprecated.
      Specified by:
      write in class OutputStream
    • write

      public final void write(byte[] iBuffer, int iOffset, int iLength)
      Deprecated.
      Overrides:
      write in class OutputStream
    • close

      public final void close()
      Deprecated.
      Equivalent to reset().
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class OutputStream
    • setAsFixed

      public final void setAsFixed(byte[] iContent)
      Deprecated.
    • set

      public int set(byte[] iContent)
      Deprecated.
      Append byte[] to the stream.
      Parameters:
      iContent -
      Returns:
      The begin offset of the appended content
      Throws:
      IOException
    • remove

      public void remove(int iBegin, int iEnd)
      Deprecated.
    • set

      public void set(byte iContent)
      Deprecated.
    • setCustom

      public final int setCustom(String iContent)
      Deprecated.
    • setUtf8

      public final int setUtf8(String iContent)
      Deprecated.
    • set

      public int set(boolean iContent)
      Deprecated.
    • set

      public int set(char iContent)
      Deprecated.
    • set

      public int set(int iContent)
      Deprecated.
    • set

      public int set(long iContent)
      Deprecated.
    • set

      public int set(short iContent)
      Deprecated.
    • getPosition

      public int getPosition()
      Deprecated.
    • setPosition

      public OMemoryStream setPosition(int iPosition)
      Deprecated.
    • fill

      public void fill(int iLength)
      Deprecated.
      Jumps bytes positioning forward of passed bytes.
      Parameters:
      iLength - Bytes to jump
    • fill

      public void fill(int iLength, byte iFiller)
      Deprecated.
      Fills the stream from current position writing iLength times the iFiller byte
      Parameters:
      iLength - Bytes to jump
      iFiller - Byte to use to fill the space
    • jump

      public OMemoryStream jump(int iOffset)
      Deprecated.
    • getAsByteArrayFixed

      public byte[] getAsByteArrayFixed(int iSize)
      Deprecated.
    • getAsByteArrayOffset

      public int getAsByteArrayOffset()
      Deprecated.
      Browse the stream but just return the begin of the byte array. This is used to lazy load the information only when needed.
    • read

      public int read()
      Deprecated.
    • read

      public int read(byte[] b)
      Deprecated.
    • read

      public int read(byte[] b, int off, int len)
      Deprecated.
    • getAsByteArray

      public byte[] getAsByteArray(int iOffset)
      Deprecated.
    • getAsByteArray

      public byte[] getAsByteArray()
      Deprecated.
    • available

      public int available()
      Deprecated.
      Returns the available bytes to read.
    • getAsString

      public String getAsString()
      Deprecated.
    • getAsBoolean

      public boolean getAsBoolean()
      Deprecated.
    • getAsChar

      public char getAsChar()
      Deprecated.
    • getAsByte

      public byte getAsByte()
      Deprecated.
    • getAsLong

      public long getAsLong()
      Deprecated.
    • getAsInteger

      public int getAsInteger()
      Deprecated.
    • getAsShort

      public short getAsShort()
      Deprecated.
    • peek

      public byte peek()
      Deprecated.
    • setSource

      public void setSource(byte[] iBuffer)
      Deprecated.
    • copy

      public byte[] copy()
      Deprecated.
    • getVariableSize

      public int getVariableSize()
      Deprecated.
    • getSize

      public int getSize()
      Deprecated.
    • size

      public final int size()
      Deprecated.