public class StreamUtil extends Object
| Constructor and Description |
|---|
StreamUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
readBInt32(InputStream s)
Reads a 4-byte signed integer from the current stream using big-endian encoding and advances the current position
of the stream by four bytes.
|
static long |
readBInt64(InputStream s)
Reads an 8-byte signed integer from the current stream using big-endian encoding and advances the current
position of the stream by eight bytes.
|
static short |
readBUInt16(InputStream s)
Reads a 2-byte unsigned integer from the current stream using big-endian encoding and advances the position of
the stream by two bytes.
|
static long |
readBUInt32(InputStream s)
Reads a 4-byte unsigned integer from the current stream using big-endian encoding and advances the position of
the stream by four bytes.
|
static long |
readBUInt64(InputStream s)
Reads an 8-byte unsigned integer from the current stream using big-endian encoding and advances the position of
the stream by eight bytes.
|
static byte[] |
readBytes(InputStream s,
int count)
Reads count bytes from the current stream into a byte array and advances the current position by count bytes.
|
static byte[] |
readToEnd(InputStream s) |
public static byte[] readBytes(InputStream s, int count) throws IOException
s - The stream to read.count - The number of bytes to read.IOException - An I/O error occurs. // @throws ObjectDisposedException The stream is closed. // @throws
ArgumentOutOfRangeException count is negative.public static byte[] readToEnd(InputStream s) throws IOException
IOExceptionpublic static int readBInt32(InputStream s) throws Exception
s - The stream to read.IOException - An I/O error occurs.Exceptionpublic static long readBInt64(InputStream s) throws Exception
s - The stream to read.Exception - //@throws EndOfStreamException The end of the stream is reached. //@throws ObjectDisposedException
The stream is closed.IOException - An I/O error occurs.public static short readBUInt16(InputStream s) throws Exception
s - The stream to read.Exception - //@throws EndOfStreamException The end of the stream is reached. //@throws ObjectDisposedException
The stream is closed.IOException - An I/O error occurs.public static long readBUInt32(InputStream s) throws Exception
s - The stream to read.Exception - //@throws EndOfStreamException The end of the stream is reached. //@throws ObjectDisposedException
The stream is closed.IOException - An I/O error occurs.public static long readBUInt64(InputStream s) throws Exception
s - The stream to read.Exception - //@throws EndOfStreamException The end of the stream is reached. //@throws ObjectDisposedException
The stream is closed.IOException - An I/O error occurs.Copyright © 2020 Open Geospatial Consortium. All rights reserved.