Package io.datarouter.bytes
Class InputStreamTool
java.lang.Object
io.datarouter.bytes.InputStreamTool
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(InputStream inputStream) static longcount(InputStream inputStream, int bufferSize) static longcountByte(InputStream inputStream, int bufferSize, byte matchByte) static byte[]readNBytes(InputStream inputStream, int len) static bytereadRequiredByte(InputStream inputStream) Read 1 byte, throwing if it wasn't found.static intreadUntilLength(InputStream inputStream, byte[] buffer, int offset, int length) Keeps reading from the InputStream until length bytes are found, or we're out of data.static io.datarouter.scanner.Scanner<byte[]>scanChunks(InputStream inputStream, int chunkSize) static byte[]toArray(InputStream inputStream) static longtransferTo(InputStream inputStream, OutputStream outputStream)
-
Constructor Details
-
InputStreamTool
public InputStreamTool()
-
-
Method Details
-
close
-
count
-
countByte
-
readRequiredByte
Read 1 byte, throwing if it wasn't found. -
readUntilLength
Keeps reading from the InputStream until length bytes are found, or we're out of data. Can be used on InputStreams that return data incrementally but you prefer to block until length bytes are found. -
readNBytes
-
scanChunks
public static io.datarouter.scanner.Scanner<byte[]> scanChunks(InputStream inputStream, int chunkSize) -
toArray
-
transferTo
-