public class BackupDataInputStream extends InputStream
InputStream-like interface for accessing an entity's data during a restore operation. Used by
BackupHelperclasses within the
is called, the current entity's header has already been read from the underlying
BackupDataInput. The entity's key string and total data size are available
through this class's
size() methods, respectively.
Note: The caller should take care not to seek or close the underlying data
source, nor read more than
size() bytes from the stream.
|Modifier and Type||Method and Description|
Report the key string associated with this entity within the backup data set.
Read one byte of entity data from the stream, returning it as an integer value.
Read enough entity data into a byte array to fill the array.
Read up to
Report the total number of bytes of data available for the current entity.
public int read() throws IOException
size()bytes of data are read from the stream, the output of this method is undefined.
public int read(byte b, int offset, int size) throws IOException
sizebytes of data into a byte array, beginning at position
offsetwithin the array.
b- Byte array into which the data will be read
offset- The data will be stored in
bbeginning at this index within the array.
size- The number of bytes to read in this operation. If insufficient data exists within the entity to fulfill this request, only as much data will be read as is available.
IOException- if the stream is closed or another IOException occurs.
public int read(byte b) throws IOException
b- Byte array to fill with data from the stream. If the stream does not have sufficient data to fill the array, then the contents of the remainder of the array will be undefined.
public String getKey()