Package com.nt.udc.ei.transport
Class OpenFileInputStream
java.lang.Object
com.nt.udc.ei.transport.OpenFileInputStream
This class is used for open file input stream.
- Since:
- JDK 1.2.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BufferedInputStream
protected File
protected InputStreamReader
protected com.nt.common.util.PosFileInputStream
protected boolean
protected long
protected long
protected long
Time awaiting for next set of data -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this open file input stream.long
Get current read position.void
mark
(int readAheadLimit) Marks the current position in the open file input stream.int
read
(byte[] buffer) Reads bytes from this open file input stream.int
read
(byte[] buffer, int offset, int count) Reads "count" bytes from the open file input stream starting at the current read position and stores the bytes read into byte array "buffer" starting at index "offset".void
reload()
void
reset()
Repositions the stream to the last marked position.long
skip
(long count) Skips bytes from this file input stream
-
Field Details
-
m_inputStream
protected com.nt.common.util.PosFileInputStream m_inputStream -
m_br
-
m_fr
-
m_isActive
protected boolean m_isActive -
m_file
-
m_mark
protected long m_mark -
m_pos
protected long m_pos -
m_timeout
protected long m_timeoutTime awaiting for next set of data
-
-
Constructor Details
-
OpenFileInputStream
- Throws:
FileNotFoundException
-
-
Method Details
-
reload
- Throws:
Exception
-
close
Closes this open file input stream.- Throws:
IOException
-
getFilePos
public long getFilePos()Get current read position. -
mark
Marks the current position in the open file input stream.- Parameters:
readAheadLimit
- The maximum read-ahead allowed before the current mark is invalidated.- Throws:
IOException
-
read
Reads bytes from this open file input stream. It reads at most buffer.length number of bytes.- Parameters:
buffer
- The buffer into which the data is read.- Returns:
- The actual number of bytes read. Return -1 if end-of-file has been reached before any bytes have been read.
- Throws:
IOException
-
read
Reads "count" bytes from the open file input stream starting at the current read position and stores the bytes read into byte array "buffer" starting at index "offset".- Parameters:
buffer
- The buffer into which the data is read.offset
- The index in buffer in which to start storing the bytes read.count
- The maximum number of bytes to read.- Returns:
- The actual number of bytes read. Return -1 if end-of-file has been reached before any bytes have been read.
- Throws:
IOException
-
reset
Repositions the stream to the last marked position.- Throws:
IOException
-
skip
Skips bytes from this file input stream- Returns:
- The actual number of bytes skipped.
- Throws:
IOException
-