public static final int | DEFAULT_BUFFER_SIZE = 8192 The size of the allocated buffers for I/O operations if the caller didn't specify it. |
public static ByteSink | Close protects the argument byte sink. |
public static ByteSource | Close protects the argument byte source. |
public static InputStream | Close protects the argument input stream. |
public static OutputStream | Close protects the argument output stream. |
public static long | Consumes the argument input stream by reading it until no more data is available. |
public static long | consumeStream( Consumes the argument input stream by reading it until no more data is available, using the given buffer. |
public static long | copyStream( Copies the bytes from argument input to the specified output. |
public static long | copyStream( Copies the bytes from argument input to the specified output using a buffer with the specified buffer size. |
public static long | copyStream( Copies the bytes from argument input to the specified output using the specified buffer. |
public static long | copyStream( Copies the bytes from argument input to the specified output. |
public static long | copyStream( Copies the bytes from argument input to the specified output using a buffer with the specified buffer size. |
public static long | copyStream( Copies the bytes from argument input to the specified output using the specified buffer. |
public static long | copyStream( Copies the bytes from argument input and updates the given message digest with it. |
public static long | copyStream( Copies the bytes from argument input and updates the given message digest with it using a buffer with the
specified buffer size. |
public static long | copyStream( Copies the bytes from argument input and updates the given message digest with it using the specified buffer. |
public static long | copyStream( Copies the bytes from argument input and updates the given signature with it. |
public static long | copyStream( Copies the bytes from argument input and updates the given signature with it using a buffer with the specified
buffer size. |
public static long | copyStream( Copies the bytes from argument input and updates the given signature with it using the specified buffer. |
public static ByteSink | Gets a byte sink that forwards its calls to the argument, and every method of it is locked using an internal
Lock. |
public static ByteSink | lockedByteSink( Gets a byte sink that forwards its calls to the argument, and every method of it is locked using an internal
Lock. |
public static ByteSource | Gets a byte source that forwards its calls to the argument, nd every method of it is locked using an internal
Lock. |
public static ByteSource | Gets a byte source that forwards its calls to the argument, and every method of it is locked using an internal
Lock. |
public static InputStream | Gets an input stream that forwards its calls to the argument, and every method of it is locked using an internal
Lock. |
public static InputStream | Gets an input stream that forwards its calls to the argument, and every method of it is locked using an internal
Lock. |
public static OutputStream | Gets an output stream that forwards its calls to the argument, and every method of it is locked using an internal
Lock. |
public static OutputStream | Gets an output stream that forwards its calls to the argument, and every method of it is locked using an internal
Lock. |
public static Appendable | Gets a null Appendable that throws away any data written to it. |
public static ByteSink | Gets a null ByteSink that throws away any data written to it. |
public static ByteSource | Gets a null ByteSource that never returns any data. |
public static DataInput | Gets a null DataInput that never returns any data. |
public static DataOutput | Gets a null DataOutput that throws away any data written to it. |
public static InputStream | Gets a null InputStream that never returns any data. |
public static ObjectInput | Gets a null ObjectInput that never returns any data. |
public static ObjectOutput | Gets a null ObjectOutput that throws away any data written to it. |
public static OutputStream | Gets a null OutputStream that throws away any data written to it. |
public static PrintStream | Gets a null PrintStream that throws away any data written to it. |
public static PrintWriter | Gets a null PrintWriter that throws away any data written to it. |
public static Readable | Gets a null Readable that never returns any data. |
public static Reader | Gets a null Reader that never returns any data. |
public static Writer | Gets a null Writer that throws away any data written to it. |
public static int | readFillObjectInputBytes( Reads bytes from the input into the argument buffer until either the buffer is filled, or no more bytes are
available. |
public static int | readFillObjectInputBytes( Reads bytes from the input into the argument buffer with the given range until either the range is filled, or no
more bytes are available. |
public static int | readFillSourceBytes( Reads bytes from the input into the argument buffer until either the buffer is filled, or no more bytes are
available. |
public static int | readFillSourceBytes( Reads bytes from the input into the argument buffer with the given range until either the range is filled, or no
more bytes are available. |
public static int | readFillStreamBytes( Reads bytes from the input into the argument buffer until either the buffer is filled, or no more bytes are
available. |
public static int | readFillStreamBytes( Reads bytes from the input into the argument buffer with the given range until either the range is filled, or no
more bytes are available. |
public static int | readFromObjectInput( Reads bytes from the given input and puts then into the argument buffer. |
public static int | readFromStream( Reads bytes from the given input and puts then into the argument buffer. |
public static CharSequence | Reads the argument readable input fully, and returns the read characters as a CharSequence. |
public static String | Reads the argument readable input fully, and returns the read characters as a String. |
public static byte[] | readSourceBytesExactly( Reads exactly the specified number of bytes from the given input or throws an EOFException if failed. |
public static void | readSourceBytesExactly( Reads the argument buffer fully or throws an EOFException if not enough bytes are available. |
public static void | readSourceBytesExactly( Reads exactly the specified number of bytes into the argument buffer with the given offset or throws an
EOFException if not enough bytes are available. |
public static ByteArrayRegion | Reads the argument input fully, and returns the read bytes. |
public static String | Reads the argument input fully, and decodes the bytes using UTF-8. |
public static String | readSourceStringFully( Reads the argument input fully, and decodes the bytes using the given charset. |
public static byte[] | readStreamBytesExactly( Reads exactly the specified number of bytes from the given input or throws an EOFException if not enough
bytes are available. |
public static void | readStreamBytesExactly( Reads the argument buffer fully or throws an EOFException if not enough bytes are available. |
public static void | readStreamBytesExactly( Reads exactly the specified number of bytes into the argument buffer with the given offset or throws an
EOFException if not enough bytes are available. |
public static ByteArrayRegion | Reads the argument input fully, and returns the read bytes. |
public static String | Reads the argument input fully, and decodes the bytes using UTF-8. |
public static String | readStreamStringFully( Reads the argument input fully, and decodes the bytes using the given charset. |
public static long | skipSourceByReading( Skips the specified number of bytes from the input by reading the given number of bytes from it. |
public static void | skipSourceExactly( Skips the argument number of bytes from the given input, throwing an EOFException if the operation fails. |
public static long | skipStreamByReading( Skips the specified number of bytes from the input by reading the given number of bytes from it. |
public static void | skipStreamExactly( Skips the argument number of bytes from the given input, throwing an EOFException if the operation fails. |
public static ByteSink | Gets a byte sink that forwards its calls to the argument, and every method of it is synchronized on
this . |
public static ByteSink | Gets a byte sink that forwards its calls to the argument, and every method of it is synchronized on
this . |
public static ByteSource | Gets a byte source that forwards its calls to the argument, and every method of it is synchronized on
this . |
public static ByteSource | Gets a byte source that forwards its calls to the argument, and every method of it is synchronized on
this . |
public static InputStream | Gets an input stream that forwards its calls to the argument, and every method of it is synchronized on
this . |
public static InputStream | Gets an input stream that forwards its calls to the argument, and every method of it is synchronized on
this . |
public static OutputStream | Gets an output stream that forwards its calls to the argument, and every method of it is synchronized on
this . |
public static OutputStream | Gets an output stream that forwards its calls to the argument, and every method of it is synchronized on
this . |
public static ByteSink | toByteSink( Converts the argument DataOutput to a ByteSink. |
public static ByteSink | toByteSink( Converts the argument MessageDigest to an ByteSink. |
public static ByteSink | toByteSink( |
public static ByteSink | toByteSink( |
public static InputStream | toInputStream( Converts the argument ObjectInput to an InputStream. |
public static OutputStream | toOutputStream( Converts the argument ObjectOutput to an OutputStream. |
public static OutputStream | toOutputStream( Converts the argument MessageDigest to an OutputStream. |
public static OutputStream | toOutputStream( Converts the argument Signature to an OutputStream. |
public static OutputStream | toOutputStream( Converts the argument Mac to an OutputStream. |
Calling ByteSource.close() on the returned source will not close the argument source.
null
if the argument is null
.Calling InputStream.close() on the returned stream will not close the argument stream.
null
if the argument is null
.Calling OutputStream.close() on the returned stream will not close the argument stream.
null
if the argument is null
.An internal work buffer is allocated with the size of DEFAULT_BUFFER_SIZE.
null
.The method will use the argument buffer to read the input to it. It is recommended that callers do not share the argument buffer for concurrent readings.
null
.A buffer with the size of DEFAULT_BUFFER_SIZE will be allocated for copying.
null
.null
.null
.A buffer with the size of DEFAULT_BUFFER_SIZE will be allocated for copying.
null
.null
.null
.A buffer with the size of DEFAULT_BUFFER_SIZE will be allocated for copying.
null
.null
.null
.A buffer with the size of DEFAULT_BUFFER_SIZE will be allocated for copying.
null
.null
.null
.null
if the argument is null
.null
if the argument is null
.null
if the argument is null
.null
if the argument is null
.null
if the argument is null
.null
if the argument is null
.null
if the argument is null
.null
if the argument is null
.
This method works like readStreamBytesExactly(
null
.
This method works like readStreamBytesExactly(
null
.
This method works like readStreamBytesExactly(
null
.
This method works like readStreamBytesExactly(
null
.
This method works like readStreamBytesExactly(
null
.
This method works like readStreamBytesExactly(
null
.This method will efficiently handle the case when the buffer is an instance of ByteArrayRegion, and read directly into the backing array.
In other cases it will allocate a work buffer that will serve as a temporary work memory region. It will be lated
put into the argument buffer via ByteRegion.put(
null
.This method will efficiently handle the case when the buffer is an instance of ByteArrayRegion, and read directly into the backing array.
In other cases it will allocate a work buffer that will serve as a temporary work memory region. It will be lated
put into the argument buffer via ByteRegion.put(
null
.null
.
This method is the same as readReadableCharSequenceFully(
null
.
Warning: If the argument input is capable of blocking, this method may never return unless external
intervention is made. If less than count
bytes are available when this method is called, the reading
will block, until either more bytes, or no more are available.
E.g. in case of a network TCP stream, if one wants to read 10 bytes, and only 5 is available right now, this method will block, until the other endpoint of the connection sends 5 more bytes, or the connection is closed.
null
.
Warning: If the argument input is capable of blocking, this method may never return unless external
intervention is made. If less than buffer.length
bytes are available when this method is called, the
reading will block, until either more bytes, or no more are available.
E.g. in case of a network TCP stream, if one wants to read 10 bytes, and only 5 is available right now, this method will block, until the other endpoint of the connection sends 5 more bytes, or the connection is closed.
null
.
Warning: If the argument input is capable of blocking, this method may never return unless external
intervention is made. If less than count
bytes are available when this method is called, the reading
will block, until either more bytes, or no more are available.
E.g. in case of a network TCP stream, if one wants to read 10 bytes, and only 5 is available right now, this method will block, until the other endpoint of the connection sends 5 more bytes, or the connection is closed.
null
.null
.null
.null
.
Warning: If the argument input is capable of blocking, this method may never return unless external
intervention is made. If less than count
bytes are available when this method is called, the reading
will block, until either more bytes, or no more are available.
E.g. in case of a network TCP stream, if one wants to read 10 bytes, and only 5 is available right now, this method will block, until the other endpoint of the connection sends 5 more bytes, or the connection is closed.
null
.
Warning: If the argument input is capable of blocking, this method may never return unless external
intervention is made. If less than buffer.length
bytes are available when this method is called, the
reading will block, until either more bytes, or no more are available.
E.g. in case of a network TCP stream, if one wants to read 10 bytes, and only 5 is available right now, this method will block, until the other endpoint of the connection sends 5 more bytes, or the connection is closed.
null
.
Warning: If the argument input is capable of blocking, this method may never return unless external
intervention is made. If less than count
bytes are available when this method is called, the reading
will block, until either more bytes, or no more are available.
E.g. in case of a network TCP stream, if one wants to read 10 bytes, and only 5 is available right now, this method will block, until the other endpoint of the connection sends 5 more bytes, or the connection is closed.
null
.null
.null
.null
.
This method will always read the bytes from the input, and never calls ByteSource.skip(
If the number of bytes to skip is zero or negative, this method will always succeed and return 0.
null
.
This method will try to skip the given number amount of bytes. It will first try to use the
ByteSource.skip(
If the number of bytes to skip is zero or negative, this method will always succeed.
null
.
This method will always read the bytes from the input, and never calls InputStream.skip(
If the number of bytes to skip is zero or negative, this method will always succeed and return 0.
null
.
This method will try to skip the given number amount of bytes. It will first try to use the
InputStream.skip(
If the number of bytes to skip is zero or negative, this method will always succeed.
null
.this
.null
if the argument is null
.this
.null
if the argument is null
.this
.null
if the argument is null
.this
.null
if the argument is null
.this
.null
if the argument is null
.this
.null
if the argument is null
.this
.null
if the argument is null
.this
.null
if the argument is null
.Closing the returned sink will not close the data output. (As the DataOutput interface doesn't extends Closeable.)
This method is similar to ByteSink.valueOf
methods, but works in a different way, therefore
it was included in this utility class instead of the ByteSink interface.
null
if the argument is
null
.null
.
All the bytes written to the byte sink will result in a call to MessageDigest.update(
Closing the returned sink will have no effect on the argument message digest.
null
if the argument is null
.
All the bytes written to the output stream will result in a call to Signature.update(
Closing the returned stream will have no effect on the argument signature object.
Any SignatureExceptions thrown by the argument will be wrapped in an IOException.
null
if the argument is null
.
All the bytes written to the byte sink will result in a call to Mac.update(
Closing the returned sink will have no effect on the argument Mac
.
null
if the argument is null
.If the argument is already an instace of InputStream, it will be simply returned.
Closing the returned stream will close the argument object input.
null
if the argument is null
.If the argument is already an instace of OutputStream, it will be simply returned.
Closing the returned stream will close the argument object output.
null
if the argument is
null
.
All the bytes written to the output stream will result in a call to
MessageDigest.update(
Closing the returned stream will have no effect on the argument message digest.
null
if the argument is null
.
All the bytes written to the output stream will result in a call to Signature.update(
Closing the returned stream will have no effect on the argument signature object.
Any SignatureExceptions thrown by the argument will be relayed in an IOException.
null
if the argument is null
.
All the bytes written to the output stream will result in a call to Mac.update(
Closing the returned stream will have no effect on the argument Mac
.
null
if the argument is null
.