Class OMemoryStream
java.lang.Object
java.io.OutputStream
com.orientechnologies.orient.core.serialization.OMemoryStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Deprecated.
Class to parse and write buffers in very fast way.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.OMemoryStream(byte[] stream) Deprecated.OMemoryStream(int initialCapacity) Deprecated.Callee takes ownership of 'buf'. -
Method Summary
Modifier and TypeMethodDescriptionintDeprecated.Returns the available bytes to read.final voidclose()Deprecated.Equivalent toreset().byte[]copy()Deprecated.voidcopyFrom(OMemoryStream iSource, int iSize) Deprecated.voidfill(int iLength) Deprecated.Jumps bytes positioning forward of passed bytes.voidfill(int iLength, byte iFiller) Deprecated.Fills the stream from current position writing iLength times the iFiller bytebooleanDeprecated.byteDeprecated.byte[]Deprecated.byte[]getAsByteArray(int iOffset) Deprecated.byte[]getAsByteArrayFixed(int iSize) Deprecated.intDeprecated.Browse the stream but just return the begin of the byte array.charDeprecated.intDeprecated.longDeprecated.shortDeprecated.Deprecated.final byte[]Deprecated.intDeprecated.intgetSize()Deprecated.intDeprecated.jump(int iOffset) Deprecated.voidmove(int iFrom, int iPosition) Deprecated.Move bytes left or right of an offset.bytepeek()Deprecated.intread()Deprecated.intread(byte[] b) Deprecated.intread(byte[] b, int off, int len) Deprecated.voidremove(int iBegin, int iEnd) Deprecated.final voidreset()Deprecated.Does not reduce the current capacity.intset(boolean iContent) Deprecated.voidset(byte iContent) Deprecated.intset(byte[] iContent) Deprecated.Append byte[] to the stream.intset(char iContent) Deprecated.intset(int iContent) Deprecated.intset(long iContent) Deprecated.intset(short iContent) Deprecated.final voidsetAsFixed(byte[] iContent) Deprecated.final intDeprecated.setPosition(int iPosition) Deprecated.voidsetSource(byte[] iBuffer) Deprecated.final intDeprecated.final intsize()Deprecated.final byte[]Deprecated.Returns the used buffer as byte[].final voidwrite(byte[] iBuffer, int iOffset, int iLength) Deprecated.final voidwrite(int b) Deprecated.final voidwriteTo(OutputStream out) Deprecated.Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
Field Details
-
DEF_SIZE
public static final int DEF_SIZEDeprecated.- See Also:
-
-
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 positioniPosition- Offset to the iFrom value: positive values mean move right, otherwise move left
-
copyFrom
Deprecated. -
writeTo
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:
writein classOutputStream
-
write
public final void write(byte[] iBuffer, int iOffset, int iLength) Deprecated.- Overrides:
writein classOutputStream
-
close
public final void close()Deprecated.Equivalent toreset().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream
-
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
Deprecated. -
setUtf8
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
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 jumpiFiller- Byte to use to fill the space
-
jump
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
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.
-
OByteArrayOutputStreaminstead.