public class

IOUtils

extends Object
java.lang.Object
   ↳ sun.misc.IOUtils

Summary

Public Constructors
IOUtils()
Public Methods
static byte[] readFully(InputStream is, int length, boolean readAll)
Read up to length of bytes from in until EOF is detected.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public IOUtils ()

Public Methods

public static byte[] readFully (InputStream is, int length, boolean readAll)

Read up to length of bytes from in until EOF is detected.

Parameters
length number of bytes to read, -1 or Integer.MAX_VALUE means read as much as possible
readAll if true, an EOFException will be thrown if not enough bytes are read. Ignored when length is -1 or Integer.MAX_VALUE
Returns
  • bytes read
Throws
IOException Any IO error or a premature EOF is detected