Package org.red5.io.utils
Class BufferUtils
- java.lang.Object
-
- org.red5.io.utils.BufferUtils
-
public class BufferUtils extends Object
Buffer Utility class which reads/writes integers to the input/output buffer- Author:
- The Red5 Project, Luke Hubbard, Codegent Ltd (luke@codegent.com), Andy Shaules (bowljoman@hotmail.com)
-
-
Constructor Summary
Constructors Constructor Description BufferUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]consumeBytes(byte[] in, int numBytesMax)Consumes bytes from an input buffer and returns them in an output buffer.static intput(org.apache.mina.core.buffer.IoBuffer out, org.apache.mina.core.buffer.IoBuffer in, int numBytesMax)Puts an input buffer in an output buffer and returns number of bytes written.static intreadMediumInt(org.apache.mina.core.buffer.IoBuffer in)Reads a Medium Int to the in bufferstatic intreadUnsignedMediumInt(org.apache.mina.core.buffer.IoBuffer in)Reads an unsigned Medium Int from the in bufferstatic voidwriteMediumInt(org.apache.mina.core.buffer.IoBuffer out, int value)Writes a Medium Int to the output buffer
-
-
-
Method Detail
-
writeMediumInt
public static void writeMediumInt(org.apache.mina.core.buffer.IoBuffer out, int value)Writes a Medium Int to the output buffer- Parameters:
out- Container to write tovalue- Integer to write
-
readUnsignedMediumInt
public static int readUnsignedMediumInt(org.apache.mina.core.buffer.IoBuffer in)
Reads an unsigned Medium Int from the in buffer- Parameters:
in- Source- Returns:
- int Integer value
-
readMediumInt
public static int readMediumInt(org.apache.mina.core.buffer.IoBuffer in)
Reads a Medium Int to the in buffer- Parameters:
in- Source- Returns:
- int Medium int
-
put
public static final int put(org.apache.mina.core.buffer.IoBuffer out, org.apache.mina.core.buffer.IoBuffer in, int numBytesMax)Puts an input buffer in an output buffer and returns number of bytes written.- Parameters:
out- Output bufferin- Input buffernumBytesMax- Number of bytes max- Returns:
- int Number of bytes written
-
consumeBytes
public static final byte[] consumeBytes(byte[] in, int numBytesMax)Consumes bytes from an input buffer and returns them in an output buffer.- Parameters:
in- Input byte arraynumBytesMax- Number of bytes max- Returns:
- out Output byte array
-
-