Reader.
When passed a users data buffer it simply operates of the
entire buffer directly.
When the input source is a stream is creates it's own local
buffers, using UnifiedInputBufferX and UnifiedDataPageX.
These allocate pages and loads them, a page at a time, from
the stream using the highest bandwidth stream interface available.
In this class the unread is only allowed to unread characters
that it actually read. This is checked, when possible, when
the local _debug is true. This is checked when
the unread is bad into data that is present in the current
buffer. When the unread crosses a buffer boundary the unread
value is simply written into the space at the beginning of the
block, which is reserved for that purpose. On all system
allocated pages the user data starts at an offset in from
the front of the buffer, The offset is set by UNREAD_LIMIT.
This is not necessary at either the beginning of the input
or for a user supplied buffer since the entire input is a
single buffer.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv UnifiedInputBufferX | |
| pack-priv byte[] | |
| pack-priv char[] | |
| private static final boolean | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv Reader | |
| pack-priv UnifiedSavePointManagerX | |
| pack-priv InputStream | |
| pack-priv static int | |
| public static final int | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private final boolean | |
| public void | close()
Implements java. Closes this stream and releases any system resources associated with it. |
| public final byte[] | |
| public final char[] | |
| public final InputStream | |
| public long | Returns: current "file" positionused to find the current position of this stream in the input source. |
| public final Reader | |
| private final void | |
| private final boolean | |
| public final boolean | |
| protected final int | |
| protected final void | |
| public static UnifiedInputStreamX | |
| public static UnifiedInputStreamX | |
| public static UnifiedInputStreamX | |
| public static UnifiedInputStreamX | |
| public static UnifiedInputStreamX | |
| public static UnifiedInputStreamX | |
| public static UnifiedInputStreamX | |
| public static UnifiedInputStreamX | |
| public final int | |
| public final int | |
| protected final int | |
| protected int | Returns: first value from the refilled input source or EOFthe refill method is the key override that is filled in by the various subclasses. |
| private final boolean | |
| private int | |
| protected final void | |
| public final UnifiedSavePointManagerX. | |
| private void | |
| public final void | |
| public final void | |
| public final boolean | |
| private final void |
| _buffer | back to summary |
|---|---|
| pack-priv UnifiedInputBufferX _buffer | |
| _bytes | back to summary |
|---|---|
| pack-priv byte[] _bytes | |
| _chars | back to summary |
|---|---|
| pack-priv char[] _chars | |
| _debug | back to summary |
|---|---|
| private static final boolean _debug | |
| _eof | back to summary |
|---|---|
| pack-priv boolean _eof | |
| _is_byte_data | back to summary |
|---|---|
| pack-priv boolean _is_byte_data | |
| _is_stream | back to summary |
|---|---|
| pack-priv boolean _is_stream | |
| _limit | back to summary |
|---|---|
| pack-priv int _limit | |
| _max_char_value | back to summary |
|---|---|
| pack-priv int _max_char_value | |
| _pos | back to summary |
|---|---|
| pack-priv int _pos | |
| _reader | back to summary |
|---|---|
| pack-priv Reader _reader | |
| _save_points | back to summary |
|---|---|
| pack-priv UnifiedSavePointManagerX _save_points | |
| _stream | back to summary |
|---|---|
| pack-priv InputStream _stream | |
| DEFAULT_PAGE_SIZE | back to summary |
|---|---|
| pack-priv static int DEFAULT_PAGE_SIZE | |
| EOF | back to summary |
|---|---|
| public static final int EOF | |
| UNREAD_LIMIT | back to summary |
|---|---|
| pack-priv static final int UNREAD_LIMIT | |
| UnifiedInputStreamX | back to summary |
|---|---|
| pack-priv UnifiedInputStreamX() | |
| can_fill_new_page | back to summary |
|---|---|
| private final boolean can_fill_new_page() | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| getByteArray | back to summary |
|---|---|
| public final byte[] getByteArray() | |
| getCharArray | back to summary |
|---|---|
| public final char[] getCharArray() | |
| getInputStream | back to summary |
|---|---|
| public final InputStream getInputStream() | |
| getPosition | back to summary |
|---|---|
| public long getPosition() used to find the current position of this stream in the input source.
| |
| getReader | back to summary |
|---|---|
| public final Reader getReader() | |
| init | back to summary |
|---|---|
| private final void init() | |
| is_byte_data | back to summary |
|---|---|
| private final boolean is_byte_data() | |
| isEOF | back to summary |
|---|---|
| public final boolean isEOF() | |
| load | back to summary |
|---|---|
| protected final int load(UnifiedDataPageX curr, int start_pos, long file_position) throws IOException | |
| make_page_current | back to summary |
|---|---|
| protected final void make_page_current(UnifiedDataPageX curr, int idx, int pos, int limit) | |
| makeStream | back to summary |
|---|---|
| public static UnifiedInputStreamX makeStream(CharSequence chars) | |
| makeStream | back to summary |
|---|---|
| public static UnifiedInputStreamX makeStream(CharSequence chars, int offset, int length) | |
| makeStream | back to summary |
|---|---|
| public static UnifiedInputStreamX makeStream(char[] chars) | |
| makeStream | back to summary |
|---|---|
| public static UnifiedInputStreamX makeStream(char[] chars, int offset, int length) | |
| makeStream | back to summary |
|---|---|
| public static UnifiedInputStreamX makeStream(Reader reader) throws IOException | |
| makeStream | back to summary |
|---|---|
| public static UnifiedInputStreamX makeStream(byte[] buffer) | |
| makeStream | back to summary |
|---|---|
| public static UnifiedInputStreamX makeStream(byte[] buffer, int offset, int length) | |
| makeStream | back to summary |
|---|---|
| public static UnifiedInputStreamX makeStream(InputStream stream) throws IOException | |
| read | back to summary |
|---|---|
| public final int read() throws IOException | |
| read | back to summary |
|---|---|
| public final int read(byte[] dst, int offset, int length) throws IOException | |
| read_helper | back to summary |
|---|---|
| protected final int read_helper() throws IOException | |
| refill | back to summary |
|---|---|
| protected int refill() throws IOException the refill method is the key override that is filled in by the various subclasses. It fills either the byte or char array with a block of data from the input source. As this is a virtual function the right version will get called for each source type. Since it is only called once per block, and from then on the final method which pulls data from the block can return the value this should be a reasonable performance trade off.
| |
| refill_helper | back to summary |
|---|---|
| private final boolean refill_helper() throws IOException | |
| refill_is_eof | back to summary |
|---|---|
| private int refill_is_eof() | |
| save_point_reset_to_prev | back to summary |
|---|---|
| protected final void save_point_reset_to_prev(UnifiedSavePointManagerX. | |
| savePointAllocate | back to summary |
|---|---|
| public final UnifiedSavePointManagerX. | |
| set_current_page | back to summary |
|---|---|
| private void set_current_page(int new_page_idx, UnifiedDataPageX new_page, int pos) | |
| skip | back to summary |
|---|---|
| public final void skip(int skipDistance) throws IOException | |
| unread | back to summary |
|---|---|
| public final void unread(int c) | |
| unread_optional_cr | back to summary |
|---|---|
| public final boolean unread_optional_cr() | |
| verify_matched_unread | back to summary |
|---|---|
| private final void verify_matched_unread(int c) | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| FromByteArray | back to summary |
|---|---|
| pack-priv FromByteArray(byte[] bytes, int offset, int length) | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides com. Implements java. Closes this stream and releases any system resources associated with it. |
| FromByteStream | back to summary |
|---|---|
| pack-priv FromByteStream(InputStream stream) throws IOException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides com. Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| FromCharArray | back to summary |
|---|---|
| pack-priv FromCharArray(CharSequence chars, int offset, int length) | |
| FromCharArray | back to summary |
|---|---|
| pack-priv FromCharArray(char[] charArray, int offset, int length) | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides com. Implements java. Closes this stream and releases any system resources associated with it. |
| FromCharStream | back to summary |
|---|---|
| pack-priv FromCharStream(Reader reader) throws IOException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides com. Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |