public class KeyedFile extends AS400File implements java.io.Serializable
MemberList
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
KEY_EQ
Constant indicating search type of equal.
|
static int |
KEY_GE
Constant indicating search type of greater than or equal.
|
static int |
KEY_GT
Constant indicating search type of greater than.
|
static int |
KEY_LE
Constant indicating search type of less than or equal.
|
static int |
KEY_LT
Constant indicating search type of less than.
|
protected static int[] |
TYPE_TABLE |
BLANK, COMMIT_LOCK_LEVEL_ALL, COMMIT_LOCK_LEVEL_CHANGE, COMMIT_LOCK_LEVEL_CURSOR_STABILITY, COMMIT_LOCK_LEVEL_DEFAULT, COMMIT_LOCK_LEVEL_NONE, longRecordNumber, READ_ALLOW_SHARED_READ_LOCK, READ_ALLOW_SHARED_WRITE_LOCK, READ_EXCLUSIVE_LOCK, READ_ONLY, READ_WRITE, SOURCE_MEMBER_TEXT, TYPE_DATA, TYPE_SOURCE, WRITE_ALLOW_SHARED_READ_LOCK, WRITE_ALLOW_SHARED_WRITE_LOCK, WRITE_EXCLUSIVE_LOCK, WRITE_ONLY
Constructor and Description |
---|
KeyedFile()
Constructs a KeyedFile object.
|
KeyedFile(AS400 system,
java.lang.String name)
Constructs a KeyedFile object.
|
Modifier and Type | Method and Description |
---|---|
void |
deleteRecord(byte[] key,
int numberOfKeyFields)
Deletes the record specified by key.
|
void |
deleteRecord(java.lang.Object[] key)
Deletes the record specified by key.
|
void |
positionCursor(byte[] key,
int numberOfKeyFields)
Positions the file cursor to the first record matching the specified
key.
|
void |
positionCursor(byte[] key,
int searchType,
int numberOfKeyFields)
Positions the file cursor to the first record meeting the specified search criteria
based on key.
|
void |
positionCursor(java.lang.Object[] key)
Positions the file cursor to the first record matching the specified
key.
|
void |
positionCursor(java.lang.Object[] key,
int searchType)
Positions the file cursor to the first record meeting the specified search criteria
based on key.
|
void |
positionCursorAfter(byte[] key,
int numberOfKeyFields)
Positions the file cursor to the first record after the record specified
by key.
|
void |
positionCursorAfter(java.lang.Object[] key)
Positions the file cursor to the first record after the record specified
by key.
|
void |
positionCursorBefore(byte[] key,
int numberOfKeyFields)
Positions the file cursor to the first record before the record specified
by key.
|
void |
positionCursorBefore(java.lang.Object[] key)
Positions the file cursor to the first record before the record specified
by key.
|
Record |
read(byte[] key,
int numberOfKeyFields)
Reads the first record with the specified key.
|
Record |
read(byte[] key,
int searchType,
int numberOfKeyFields)
Reads the first record meeting the specified search criteria based on
key.
|
Record |
read(java.lang.Object[] key)
Reads the first record with the specified key.
|
Record |
read(java.lang.Object[] key,
int searchType)
Reads the first record meeting the specified search criteria based on
key.
|
Record |
readAfter(byte[] key,
int numberOfKeyFields)
Reads the first record after the record with the specified key.
|
Record |
readAfter(java.lang.Object[] key)
Reads the first record after the record with the specified key.
|
Record[] |
readAll()
Reads all the records in the file.
|
Record |
readBefore(byte[] key,
int numberOfKeyFields)
Reads the first record before the record with the specified key.
|
Record |
readBefore(java.lang.Object[] key)
Reads the first record before the record with the specified key.
|
Record |
readNextEqual()
Reads the next record whose key matches the full key of the current record.
|
Record |
readNextEqual(byte[] key,
int numberOfKeyFields)
Reads the next record whose key matches the specified key.
|
Record |
readNextEqual(java.lang.Object[] key)
Reads the next record whose key matches the specified key.
|
Record |
readPreviousEqual()
Reads the previous record whose key matches the key of the current record.
|
Record |
readPreviousEqual(byte[] key,
int numberOfKeyFields)
Reads the previous record whose key matches the specified key.
|
Record |
readPreviousEqual(java.lang.Object[] key)
Reads the previous record whose key matches the specified key.
|
void |
setLongRecordNumber(boolean v)
Set to read records with Record Number in long type.
|
void |
update(byte[] key,
Record record,
int numberOfKeyFields)
Updates the record specified by key.
|
void |
update(byte[] key,
Record record,
int searchType,
int numberOfKeyFields)
Updates the first record meeting the specified search criteria based on
key.
|
void |
update(java.lang.Object[] key,
Record record)
Updates the record specified by key.
|
void |
update(java.lang.Object[] key,
Record record,
int searchType)
Updates the first record meeting the specified search criteria based on
key.
|
addFileListener, addPhysicalFileMember, addPropertyChangeListener, addVetoableChangeListener, close, commit, commit, create, create, create, create, delete, deleteCurrentRecord, deleteMember, endCommitmentControl, endCommitmentControl, finalize, getBlockingFactor, getCommitLockLevel, getExplicitLocks, getFileName, getLibraryName, getMemberName, getPath, getRecordFormat, getSystem, isCommitmentControlStarted, isCommitmentControlStarted, isOpen, isReadNoUpdate, isReadOnly, isReadWrite, isSSPFile, isWriteOnly, lock, open, open, positionCursorAfterLast, positionCursorBeforeFirst, positionCursorToFirst, positionCursorToLast, positionCursorToNext, positionCursorToPrevious, read, readFirst, readLast, readNext, readPrevious, refreshRecordCache, releaseExplicitLocks, removeFileListener, removePropertyChangeListener, removeVetoableChangeListener, rollback, rollback, runCommand, setPath, setReadNoUpdate, setRecordFormat, setRecordFormat, setRecordFormat, setRecordFormat, setSSPFile, setSystem, startCommitmentControl, startCommitmentControl, update, write, write
public static final int KEY_EQ
public static final int KEY_GT
public static final int KEY_GE
public static final int KEY_LT
public static final int KEY_LE
protected static final int[] TYPE_TABLE
public KeyedFile()
public KeyedFile(AS400 system, java.lang.String name)
system
- The system to which to connect. The system cannot
be null.name
- The integrated file system pathname of the file. The name
cannot be null.public void setLongRecordNumber(boolean v)
v
- public void deleteRecord(java.lang.Object[] key) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported. The number of elements in key cannot exceed the
number of key fields in the record format for this file.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void deleteRecord(byte[] key, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.numberOfKeyFields
- The number of key fields contained in the byte array key. This number cannot exceed the
total number of key fields in the record format for this file.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursor(java.lang.Object[] key) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursor(byte[] key, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.numberOfKeyFields
- The number of key fields contained in the byte array key.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursor(java.lang.Object[] key, int searchType) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.searchType
- Constant indicating the type of match required. Valid values are:
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursor(byte[] key, int searchType, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.searchType
- Constant indicating the type of match required. Valid values are:
numberOfKeyFields
- The number of key fields contained in the byte array key.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursorAfter(java.lang.Object[] key) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The values which make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursorAfter(byte[] key, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values which make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.numberOfKeyFields
- The number of key fields contained in the byte array key.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursorBefore(java.lang.Object[] key) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The values which make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursorBefore(byte[] key, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values which make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.numberOfKeyFields
- The number of key fields contained in the byte array key.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record read(java.lang.Object[] key) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record read(byte[] key, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.numberOfKeyFields
- The number of key fields contained in the byte array key.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record read(java.lang.Object[] key, int searchType) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.searchType
- Constant indicating the type of match required. Valid values are:
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record read(byte[] key, int searchType, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.searchType
- Constant indicating the type of match required. Valid values are:
numberOfKeyFields
- The number of key fields contained in the byte array key.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record readAfter(java.lang.Object[] key) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record readAfter(byte[] key, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.numberOfKeyFields
- The number of key fields contained in the byte array key.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record[] readAll() throws AS400Exception, AS400SecurityException, ConnectionDroppedException, java.lang.InterruptedException, java.io.IOException, ServerStartupException, java.net.UnknownHostException
readAll
in class AS400File
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.public Record readBefore(java.lang.Object[] key) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record readBefore(byte[] key, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.numberOfKeyFields
- The number of key fields contained in the byte array key.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record readNextEqual() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record readNextEqual(java.lang.Object[] key) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record readNextEqual(byte[] key, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
numberOfKeyFields
- The number of key fields contained in the byte array key.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record readPreviousEqual() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record readPreviousEqual(java.lang.Object[] key) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record readPreviousEqual(byte[] key, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.numberOfKeyFields
- The number of key fields contained in the byte array key.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void update(java.lang.Object[] key, Record record) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.record
- The record with which to update the existing record.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void update(byte[] key, Record record, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.record
- The record with which to update the existing record.numberOfKeyFields
- The number of key fields contained in the byte array key.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void update(java.lang.Object[] key, Record record, int searchType) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.record
- The record with which to update the existing record.searchType
- Constant indicating the type of match required. Valid values are:
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void update(byte[] key, Record record, int searchType, int numberOfKeyFields) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
key
- The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.record
- The record with which to update the existing record.searchType
- Constant indicating the type of match required. Valid values are:
numberOfKeyFields
- The number of key fields contained in the byte array key.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.