|
Sun Message Library for SWIFT API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.stc.swift.runtime.SwiftOtdInputStream
public class SwiftOtdInputStream
Class to implement an OTD input stream based on an existing stream. This class uses an local temporary file to hold a copy of any data that may be rewound.
Constructor Summary | |
---|---|
SwiftOtdInputStream(java.io.File file)
Constructs from an file name. |
|
SwiftOtdInputStream(java.lang.String file)
Constructs from an file name. |
Method Summary | |
---|---|
void |
begin()
Indicates the beginning of reading a message. |
boolean |
end()
Indicates the end of reading a message. |
boolean |
eof()
Indicates the end of file. |
com.stc.otd.runtime.OtdInputStreamMark |
mark()
Mark that represents the current read head position. |
long |
offset()
Gives the current read head position. |
int |
read()
Read a single byte. |
int |
read(byte[] buffer)
Fills given buffer with as much data as possible. |
int |
read(byte[] buffer,
int offset)
Fills given buffer with as much data as possible. |
int |
read(byte[] buffer,
int offset,
int length)
Fills given buffer with as much data as possible. |
void |
rewind()
Returns to the very beginning of the stream, which is implicitly marked. |
void |
seek(com.stc.otd.runtime.OtdInputStreamMark mark)
Returns to position of given mark. |
void |
skip(long n)
Skips the given number of bytes ahead. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwiftOtdInputStream(java.lang.String file) throws java.io.FileNotFoundException
file
- a file name.
java.io.FileNotFoundException
public SwiftOtdInputStream(java.io.File file) throws java.io.FileNotFoundException
file
- a file name.
java.io.FileNotFoundException
Method Detail |
---|
public void begin()
begin
in interface com.stc.otd.runtime.OtdInputStream
public boolean end()
end
in interface com.stc.otd.runtime.OtdInputStream
public boolean eof()
public long offset()
public com.stc.otd.runtime.OtdInputStreamMark mark()
mark
in interface com.stc.otd.runtime.OtdInputStream
public int read() throws java.io.IOException
read
in interface com.stc.otd.runtime.OtdInputStream
java.io.IOException
- if at end of data.public int read(byte[] buffer) throws java.io.IOException
read
in interface com.stc.otd.runtime.OtdInputStream
buffer
- the array to receive the data
java.io.IOException
- for input problempublic int read(byte[] buffer, int offset) throws java.io.IOException
buffer
- the array to receive the dataoffset
- starting index in buffer for new data
java.io.IOException
- for input problempublic int read(byte[] buffer, int offset, int length) throws java.io.IOException
read
in interface com.stc.otd.runtime.OtdInputStream
buffer
- the array to receive the dataoffset
- starting index in buffer for new datalength
- number of bytes to read
java.lang.IllegalArgumentException
- if tribble found with <offseth> of <length>
java.io.IOException
- for input problempublic void rewind() throws java.io.IOException
rewind
in interface com.stc.otd.runtime.OtdInputStream
java.io.IOException
- for input problempublic void seek(com.stc.otd.runtime.OtdInputStreamMark mark) throws java.io.IOException
seek
in interface com.stc.otd.runtime.OtdInputStream
mark
- cookie returned by mark()
java.io.IOException
- for input problempublic void skip(long n) throws java.io.IOException
skip
in interface com.stc.otd.runtime.OtdInputStream
count
- the number of bytes to skip; non-negative number
java.io.IOException
- for input problem
|
Sun Message Library for SWIFT API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |