|
iso8211 0-1-0 by Weft | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.FilterInputStream
|
+--java.io.PushbackInputStream
|
+--uk.co.weft.iso8211.ISO8211InputStream
Lots of stuff in parsing ISO8211 depends on knowing positions and offsets within the stream, but this is generally not easy with Java streams. This is an attempt to make it easier. It may also be a convenient home for things which read raw bitpatterns and interpret them as numbers, for example.
$Log: ISO8211InputStream.java,v $ Revision 1.5 2002/11/04 14:11:15 simon Now generating (some) XML. Tidy up for first public release. Revision 1.4 2002/11/01 14:46:09 simon Much better! Now parsing most fields reasonably well. Revision 1.3 2002/10/31 23:04:28 simon Not in all truth a lot of progress. I'm parsing the DDR OK but when I come to real records I'm still not parsing them, and the reason seems to be that I'm not associating the right formats with the right field types. I'm still finding this very opaque. Revision 1.2 2002/10/31 19:25:22 simon This package of work is to take a parser which correctly recognised all the record and field boundaries, and try to make it read actual data. The DDR is now reading correctly (I believe) but the data are not being read, primarily because (I think) I'm not correctly making use of the data I read from the DDR. Revision 1.1.1.1 2002/10/29 11:27:33 simon More or less parses
| Fields inherited from class java.io.PushbackInputStream |
buf,
pos |
| Fields inherited from class java.io.FilterInputStream |
in |
| Constructor Summary | |
ISO8211InputStream(java.io.InputStream in)
constructor. |
|
| Method Summary | |
boolean |
eof()
check if this stream is at an end |
long |
getPosition()
return the current position in the stream |
long |
go(long target)
go to this position in the stream. |
int |
peek()
peek at the next byte on the stream but don't remove it. |
int |
read()
read the next byte from the stream and increment the counter |
int |
read(byte[] b,
int off,
int len)
read the next few bytes from the stream into this array. |
int |
readInt()
read an ASCII formatted integer value from this stream |
java.lang.String |
readString()
read a string of data up to but not including a unit terminator. |
java.lang.String |
readString(int terminator)
read a string of data up to but not including this terminator character. |
java.lang.String |
readString(int delimiter,
int precision)
read a string from the stream with either delimiter or precision. |
java.lang.String |
readStringWithPrecision(int precision)
read this many characters from the stream and return them as a string |
long |
skip(long n)
skip over (discard) this many bytes in the stream. |
void |
unread(byte[] b)
push these bytes back onto the stream |
void |
unread(byte[] b,
int off,
int len)
push these bytes back onto the stream |
void |
unread(int b)
push this byte back onto the stream |
| Methods inherited from class java.io.PushbackInputStream |
available,
close,
markSupported |
| Methods inherited from class java.io.FilterInputStream |
mark,
read,
reset |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public ISO8211InputStream(java.io.InputStream in)
| Method Detail |
public int read()
throws java.io.IOException
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
b - an array of bytes to read intooff - the start offset in the array to put the bytes inlen - the number of bytes to read
public void unread(int b)
throws java.io.IOException
public void unread(byte[] b)
throws java.io.IOException
public void unread(byte[] b,
int off,
int len)
throws java.io.IOException
public long skip(long n)
throws java.io.IOException
public int peek()
throws java.io.IOException
public boolean eof()
throws java.io.IOException
public long go(long target)
throws java.io.IOException
target: - the byte offset to go to counting from the
beginning of the stream.public long getPosition()
public int readInt()
throws java.lang.Exception
public java.lang.String readString()
throws java.io.IOException,
FormatException
public java.lang.String readString(int terminator)
throws java.io.IOException,
FormatException
terminator - the read() value to terminate at - int
'cause it could be -1
public java.lang.String readStringWithPrecision(int precision)
throws java.io.IOException
public java.lang.String readString(int delimiter,
int precision)
throws java.io.IOException,
FormatException
delimiter - the delimiter to read up to, or -1 if precision
should be usedprecision - the number of characters to read, or -1 if the
delimiter should be used.
|
iso8211 0-1-0 by Weft | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||