Class StreamUtil
This file is a helper class for internal usage only.
public sealed class StreamUtil
- Inheritance
-
StreamUtil
- Inherited Members
Remarks
This file is a helper class for internal usage only. Be aware that its API and functionality may be changed in future.
Methods
CopyBytes(IRandomAccessSource, long, long, Stream)
Copy bytes from the
RandomAccessSource
to
OutputStream
.
public static void CopyBytes(IRandomAccessSource source, long start, long length, Stream output)
Parameters
source
IRandomAccessSourcethe
RandomAccessSource
copy from.start
longstart position of source copy from.
length
longlength copy to.
output
Streamthe
OutputStream
copy to.
CreateBufferedEscapedString(byte[])
public static ByteBuffer CreateBufferedEscapedString(byte[] bytes)
Parameters
bytes
byte[]
Returns
CreateBufferedHexedString(byte[])
public static ByteBuffer CreateBufferedHexedString(byte[] bytes)
Parameters
bytes
byte[]
Returns
CreateEscapedString(byte[])
Escapes a
byte
array according to the PDF conventions.
public static byte[] CreateEscapedString(byte[] bytes)
Parameters
bytes
byte[]the
byte
array to escape
Returns
- byte[]
an escaped
byte
array
InputStreamToArray(Stream)
Reads the full content of a stream and returns them in a byte array
public static byte[] InputStreamToArray(Stream stream)
Parameters
stream
Streamthe stream to read
Returns
- byte[]
a byte array containing all of the bytes from the stream
ReadFully(Stream, byte[], int, int)
Reads
len
bytes from an input stream.
public static void ReadFully(Stream input, byte[] b, int off, int len)
Parameters
input
Streamb
byte[]the buffer into which the data is read.
off
intan int specifying the offset into the data.
len
intan int specifying the number of bytes to read.
Skip(Stream, long)
This method is an alternative for the
InputStream.skip()
-method that doesn't seem to work properly for big values of
size
.
public static void Skip(Stream stream, long size)
Parameters
TransferBytes(Stream, Stream)
public static void TransferBytes(Stream input, Stream output)
Parameters
TransferBytes(RandomAccessFileOrArray, Stream)
public static void TransferBytes(RandomAccessFileOrArray input, Stream output)
Parameters
input
RandomAccessFileOrArrayoutput
Stream
WriteEscapedString(Stream, byte[])
Escapes a
byte
array according to the PDF conventions.
public static void WriteEscapedString(Stream outputStream, byte[] bytes)
Parameters
outputStream
Streamthe
OutputStream
an escapedbyte
array write to.bytes
byte[]the
byte
array to escape.
WriteHexedString(Stream, byte[])
public static void WriteHexedString(Stream outputStream, byte[] bytes)