public class StreamUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_BUFFER_SIZE |
| Constructor and Description |
|---|
StreamUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
copy(InputStream input,
OutputStream output) |
static String |
digestAsHex(MessageDigest messageDigest) |
static MessageDigest |
getDigest(String algorithm) |
static MessageDigest |
getSha1Digest() |
static byte[] |
read(InputStream input) |
static int |
read(InputStream input,
byte[] dst) |
static int |
read(InputStream input,
byte[] dst,
int offset) |
static int |
read(InputStream input,
org.agrona.MutableDirectBuffer buffer,
int offset) |
static long |
readLong(InputStream inputStream) |
static String |
sha1Hex(InputStream data) |
static MessageDigest |
updateDigest(MessageDigest messageDigest,
InputStream data) |
static void |
write(org.agrona.DirectBuffer source,
OutputStream destination)
Writes the
DirectBuffer.capacity() bytes given buffer to the destination output. |
static void |
write(org.agrona.DirectBuffer source,
OutputStream destination,
int offset,
int length)
Writes length bytes from source buffer, starting at the given offset, into the given
destination.
|
static void |
write(File file,
InputStream data,
MessageDigest messageDigest) |
static void |
write(File file,
String data) |
static void |
writeLong(OutputStream outputStream,
long longValue) |
protected static final int DEFAULT_BUFFER_SIZE
public static MessageDigest getDigest(String algorithm)
public static MessageDigest getSha1Digest()
public static MessageDigest updateDigest(MessageDigest messageDigest, InputStream data) throws IOException
IOExceptionpublic static String sha1Hex(InputStream data) throws IOException
IOExceptionpublic static String digestAsHex(MessageDigest messageDigest)
public static int copy(InputStream input, OutputStream output) throws IOException
IOExceptionpublic static void write(File file, String data) throws IOException
IOExceptionpublic static void write(File file, InputStream data, MessageDigest messageDigest) throws IOException
IOExceptionpublic static int read(InputStream input, byte[] dst) throws IOException
IOExceptionpublic static int read(InputStream input, org.agrona.MutableDirectBuffer buffer, int offset) throws IOException
IOExceptionpublic static int read(InputStream input, byte[] dst, int offset) throws IOException
IOExceptionpublic static byte[] read(InputStream input) throws IOException
IOExceptionpublic static void write(org.agrona.DirectBuffer source,
OutputStream destination)
throws IOException
DirectBuffer.capacity() bytes given buffer to the destination output.source - buffer to writedestination - output to write toIOExceptionpublic static void write(org.agrona.DirectBuffer source,
OutputStream destination,
int offset,
int length)
throws IOException
source - buffer to writedestination - output to write tooffset - offset at which to start writing from bufferlength - number of bytes to writeIOExceptionpublic static void writeLong(OutputStream outputStream, long longValue) throws IOException
IOExceptionpublic static long readLong(InputStream inputStream) throws IOException
IOExceptionCopyright © 2017–2019 camunda services GmbH. All rights reserved.