public class StreamingUtils extends Object
| Constructor and Description |
|---|
StreamingUtils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
intToBytes(int value)
Converting int to bytes
|
static byte[] |
longToBytes(long value)
Converting long to bytes
|
static void |
readBytes(byte[] buffer,
int offset,
int count,
InputStream stream)
Reading bytes from stream
|
static byte[] |
readBytes(int count,
InputStream stream)
Reading bytes from stream
|
static double |
readDouble(InputStream stream)
Reading double from stream
|
static int |
readInt(byte[] src)
Reading int from bytes array
|
static int |
readInt(byte[] src,
int offset)
Reading int from bytes array
|
static int |
readInt(InputStream stream) |
static long |
readLong(byte[] src,
int offset)
Reading long value from bytes array
|
static long |
readLong(InputStream stream)
Reading long from stream
|
static boolean |
readTLBool(InputStream stream)
Reading tl-bool from stream
|
static byte[] |
readTLBytes(InputStream stream)
Reading tl-bytes from stream
|
static TLBytes |
readTLBytes(InputStream stream,
TLContext context)
Reading tl-bytes from stream with manual allocation
|
static TLIntVector |
readTLIntVector(InputStream stream,
TLContext context)
Reading tl-vector of integers from stream
|
static TLLongVector |
readTLLongVector(InputStream stream,
TLContext context)
Reading tl-vector of longs from stream
|
static TLMethod |
readTLMethod(InputStream stream,
TLContext context)
Reading tl-method from stream.
|
static TLObject |
readTLObject(InputStream stream,
TLContext context)
Reading tl-object from stream
|
static <T extends TLObject> |
readTLObject(InputStream stream,
TLContext context,
Class<T> type) |
static String |
readTLString(InputStream stream)
Reading tl-string from stream
|
static TLStringVector |
readTLStringVector(InputStream stream,
TLContext context)
Reading tl-vector of strings from stream
|
static TLVector |
readTLVector(InputStream stream,
TLContext context)
Reading tl-vector from stream
|
static <T> TLVector<T> |
readTLVector(InputStream stream,
TLContext context,
Class<T> vectorType)
Reading tl-vector from stream
|
static long |
readUInt(byte[] src)
Reading uint from bytes array
|
static long |
readUInt(byte[] src,
int offset)
Reading uint from bytes array
|
static long |
readUInt(InputStream stream)
Reading uint from stream
|
static void |
skipBytes(int count,
InputStream stream)
Reading bytes from stream
|
static void |
writeByte(byte v,
OutputStream stream)
Writing byte to stream
|
static void |
writeByte(int v,
OutputStream stream)
Writing byte to stream
|
static void |
writeByteArray(byte[] data,
int offset,
int len,
OutputStream stream)
Writing byte array to stream
|
static void |
writeByteArray(byte[] data,
OutputStream stream)
Writing byte array to stream
|
static void |
writeDouble(double v,
OutputStream stream)
Writing double to stream
|
static void |
writeInt(int v,
OutputStream stream)
Writing int to stream
|
static void |
writeLong(long v,
OutputStream stream)
Writing long to stream
|
static void |
writeTLBool(boolean v,
OutputStream stream)
Writing tl-bool value
|
static void |
writeTLBytes(byte[] v,
OutputStream stream)
Writing tl-bytes value
|
static void |
writeTLBytes(TLBytes v,
OutputStream stream)
Writing tl-bytes value
|
static void |
writeTLMethod(TLMethod v,
OutputStream stream)
Writing tl-method to stream.
|
static void |
writeTLObject(TLObject v,
OutputStream stream)
Writing tl-object to stream
|
static void |
writeTLString(String v,
OutputStream stream)
Writing tl-string value
|
static void |
writeTLVector(TLVector v,
OutputStream stream)
Writing tl-vector to stream
|
static int |
ºreadInt(InputStream stream)
Reading int from stream
|
public static void writeByte(int v,
OutputStream stream)
throws IOException
v - valuestream - destination streamIOExceptionpublic static void writeByte(byte v,
OutputStream stream)
throws IOException
v - valuestream - destination streamIOExceptionpublic static void writeInt(int v,
OutputStream stream)
throws IOException
v - valuestream - destination streamIOExceptionpublic static void writeLong(long v,
OutputStream stream)
throws IOException
v - valuestream - destination streamIOExceptionpublic static void writeDouble(double v,
OutputStream stream)
throws IOException
v - valuestream - destination streamIOExceptionpublic static void writeByteArray(byte[] data,
OutputStream stream)
throws IOException
data - datastream - destination streamIOExceptionpublic static void writeByteArray(byte[] data,
int offset,
int len,
OutputStream stream)
throws IOException
data - datastream - destination streamIOExceptionpublic static void writeTLBool(boolean v,
OutputStream stream)
throws IOException
v - valuestream - destination streamIOExceptionpublic static void writeTLString(String v, OutputStream stream) throws IOException
v - valuestream - destination streamIOExceptionpublic static void writeTLBytes(byte[] v,
OutputStream stream)
throws IOException
v - valuestream - destination streamIOExceptionpublic static void writeTLBytes(TLBytes v, OutputStream stream) throws IOException
v - valuestream - destination streamIOExceptionpublic static void writeTLObject(TLObject v, OutputStream stream) throws IOException
v - tl-objectstream - destination streamIOExceptionpublic static void writeTLMethod(TLMethod v, OutputStream stream) throws IOException
v - tl-methodstream - destination streamIOExceptionpublic static void writeTLVector(TLVector v, OutputStream stream) throws IOException
v - tl-vectorstream - destination streamIOExceptionpublic static int ºreadInt(InputStream stream) throws IOException
stream - source streamIOException - reading exceptionpublic static long readUInt(InputStream stream) throws IOException
stream - source streamIOException - reading exceptionpublic static long readLong(InputStream stream) throws IOException
stream - source streamIOException - reading exceptionpublic static double readDouble(InputStream stream) throws IOException
stream - source streamIOException - reading exceptionpublic static String readTLString(InputStream stream) throws IOException
stream - source streamIOException - reading exceptionpublic static TLObject readTLObject(InputStream stream, TLContext context) throws IOException
stream - source streamcontext - tl-contextIOException - reading exceptionpublic static <T extends TLObject> T readTLObject(InputStream stream, TLContext context, Class<T> type) throws IOException
IOExceptionpublic static TLMethod readTLMethod(InputStream stream, TLContext context) throws IOException
stream - source streamcontext - tl-methodIOException - reading exceptionpublic static byte[] readBytes(int count,
InputStream stream)
throws IOException
count - bytes countstream - source streamIOException - reading exceptionpublic static void skipBytes(int count,
InputStream stream)
throws IOException
count - bytes countstream - source streamIOException - reading exceptionpublic static void readBytes(byte[] buffer,
int offset,
int count,
InputStream stream)
throws IOException
count - bytes countstream - source streamIOException - reading exceptionpublic static byte[] readTLBytes(InputStream stream) throws IOException
stream - source streamIOException - reading exceptionpublic static TLBytes readTLBytes(InputStream stream, TLContext context) throws IOException
stream - source streamcontext - tl-contextIOException - reading exceptionpublic static TLVector readTLVector(InputStream stream, TLContext context) throws IOException
stream - source streamcontext - tl-contextIOException - reading exceptionpublic static <T> TLVector<T> readTLVector(InputStream stream, TLContext context, Class<T> vectorType) throws IOException
stream - source streamcontext - tl-contextIOException - reading exceptionpublic static TLIntVector readTLIntVector(InputStream stream, TLContext context) throws IOException
stream - source streamcontext - tl-contextIOException - reading exceptionpublic static TLLongVector readTLLongVector(InputStream stream, TLContext context) throws IOException
stream - source streamcontext - tl-contextIOException - reading exceptionpublic static TLStringVector readTLStringVector(InputStream stream, TLContext context) throws IOException
stream - source streamcontext - tl-contextIOException - reading exceptionpublic static boolean readTLBool(InputStream stream) throws IOException
stream - source streamIOException - reading exceptionpublic static byte[] intToBytes(int value)
value - source integerpublic static byte[] longToBytes(long value)
value - source longpublic static int readInt(byte[] src)
src - source bytespublic static int readInt(byte[] src,
int offset)
src - source bytesoffset - offset in arraypublic static int readInt(InputStream stream) throws IOException
IOExceptionpublic static long readUInt(byte[] src)
src - source bytespublic static long readUInt(byte[] src,
int offset)
src - source bytesoffset - offset in arraypublic static long readLong(byte[] src,
int offset)
src - source bytesoffset - offset in arrayCopyright © 2017. All rights reserved.