public final class DataIO extends Object
| Modifier and Type | Method and Description |
|---|---|
static IByteReader |
ToByteReader(byte[] bytes)
Deprecated.
Use ToReader instead.
|
static IByteReader |
ToByteReader(byte[] bytes,
int offset,
int length)
Deprecated.
Use ToReader instead.
|
static IByteReader |
ToByteReader(InputStream input)
Deprecated.
Use ToReader instead.
|
static IReader |
ToReader(byte[] bytes)
Wraps a byte array into a byte reader.
|
static IReader |
ToReader(byte[] bytes,
int offset,
int length)
Wraps a portion of a byte array into a byte reader object.
|
static IReader |
ToReader(InputStream input)
Wraps an input stream into a reader object.
|
static IWriter |
ToWriter(IByteWriter output)
Wraps a byte writer (one that only implements a ReadByte method) to a writer
(one that also implements a three-parameter Read method.)
|
static IWriter |
ToWriter(OutputStream output)
Wraps an output stream into a writer object.
|
public static IReader ToReader(byte[] bytes)
In the .NET implementation, this
method is implemented as an extension method to any byte array object
and can be called as follows: bytes.ToByteReader(). If the
object's class already has a ToByteReader method with the same
parameters, that method takes precedence over this extension
method.
bytes - The byte array to wrap.NullPointerException - The parameter bytes is null.public static IReader ToReader(byte[] bytes, int offset, int length)
In the .NET
implementation, this method is implemented as an extension method to
any byte array object and can be called as follows:
bytes.ToByteReader(offset, length). If the object's class
already has a ToByteReader method with the same parameters, that
method takes precedence over this extension method.
bytes - The byte array to wrap.offset - A zero-based index showing where the desired portion of
"bytes" begins.length - The length, in bytes, of the desired portion of "bytes" (but
not more than "bytes" 's length).NullPointerException - The parameter bytes is null.IllegalArgumentException - Either offset or length is
less than 0 or greater than bytes 's length, or bytes
' s length minus offset is less than length.public static IReader ToReader(InputStream input)
In the .NET implementation, this method is implemented as
an extension method to any object implementing InputStream and can be
called as follows: input.ToByteReader(). If the object's class
already has a ToByteReader method with the same parameters, that
method takes precedence over this extension method.
input - The input stream to wrap.NullPointerException - The parameter input is null.@Deprecated public static IByteReader ToByteReader(byte[] bytes, int offset, int length)
In the .NET implementation, this method is
implemented as an extension method to any object implementing byte[]
and can be called as follows: bytes.ToByteReader(offset,
length). If the object's class already has a ToByteReader method
with the same parameters, that method takes precedence over this
extension method.
bytes - The parameter bytes is not documented yet.offset - A zero-based index showing where the desired portion of bytes begins.length - The length, in bytes, of the desired portion of bytes
(but not more than bytes 's length).IllegalArgumentException - Either offset or length is
less than 0 or greater than bytes 's length, or bytes
' s length minus offset is less than length.NullPointerException - The parameter bytes is null.@Deprecated public static IByteReader ToByteReader(InputStream input)
In the .NET implementation, this method is
implemented as an extension method to any object implementing InputStream
and can be called as follows: input.ToByteReader(). If the
object's class already has a ToByteReader method with the same
parameters, that method takes precedence over this extension
method.
input - The parameter input is not documented yet.@Deprecated public static IByteReader ToByteReader(byte[] bytes)
In the .NET implementation, this method is
implemented as an extension method to any object implementing byte[]
and can be called as follows: bytes.ToByteReader(). If the
object's class already has a ToByteReader method with the same
parameters, that method takes precedence over this extension
method.
bytes - The parameter bytes is not documented yet.public static IWriter ToWriter(OutputStream output)
In the .NET implementation, this method is implemented as
an extension method to any object implementing InputStream and can be
called as follows: output.ToWriter(). If the object's class
already has a ToWriter method with the same parameters, that method
takes precedence over this extension method.
output - Output stream to wrap.NullPointerException - The parameter output is null.public static IWriter ToWriter(IByteWriter output)
In the
.NET implementation, this method is implemented as an extension
method to any object implementing IByteWriter and can be called as
follows: output.ToWriter(). If the object's class already has
a ToWriter method with the same parameters, that method takes
precedence over this extension method.
output - A byte stream.NullPointerException - The parameter output is null.Encoding for Java documentation, generated in 2017.