Encoding used for an entity (including main document entity) is determined using algorithms suggested in XML 1.0#3 spec, appendix F
| Modifier and Type | Field and Description |
|---|---|
| pack-priv boolean | |
| private byte[] | |
| pack-priv boolean | |
| pack-priv int | mBytesPerChar
For most encodings, number of physical characters needed for decoding xml declaration characters (which for variable length encodings like UTF-8 will be 1). |
| pack-priv boolean | mEBCDIC
Special case for 1-byte encodings: EBCDIC is problematic as it's not 7-bit ascii compatible. |
| pack-priv boolean | |
| pack-priv final InputStream | mIn
Underlying InputStream to use for reading content. |
| pack-priv static final int | MIN_BUF_SIZE
Let's size buffer at least big enough to contain the longest possible prefix of a document needed to positively identify it starts with the XML declaration. |
| pack-priv String | |
| private int | |
| private int | |
| private final boolean | mRecycleBuffer
Whether byte buffer is recyclable or not |
| pack-priv int[] | mSingleByteTranslation
For single-byte non-ascii-compatible encodings (ok ok, really just EBCDIC), we'll have to use a lookup table. |
| Access | Constructor and Description |
|---|---|
| private | |
| private | StreamBootstrapper(String pubId, SystemId sysId, byte[] data, int
Pointer to the first valid byte in the buffer start, int Pointer to the offset after last valid byte in the buffer end)
|
| Modifier and Type | Method and Description |
|---|---|
| public Reader | bootstrapInput(ReaderConfig cfg, boolean mainDoc, int
Optional xml version identifier of the main parsed
document (if not bootstrapping the main document).
Currently only relevant for checking that XML 1.0 document does not
include XML 1.1 external parsed entities.
If null, no checks will be done; when bootstrapping parsing of the
main document, null should be passed for this argument. xmlVersion)Implements abstract com.
|
| protected int | Returns: First character that does not match expected, if any; CHAR_NULL if match succeededImplements abstract com.
|
| protected int | Returns: First character that does not match expected, if any; CHAR_NULL if match succeeded
|
| protected int | Returns: First character that does not match expected, if any; CHAR_NULL if match succeeded
|
| protected int | |
| protected boolean | |
| public int | |
| public String | getInputEncoding()
Implements abstract com. Since this class only gets used when encoding is not explicitly passed, need use the encoding that was auto-detected... |
| public int | |
| public static StreamBootstrapper | getInstance(String pubId, SystemId sysId, InputStream in)
Factory method used when the underlying data provider is an actual stream. |
| public static StreamBootstrapper | getInstance(String pubId, SystemId sysId, byte[] data, int start, int end)
Factory method used when the underlying data provider is a pre-allocated block source, and no stream is used. |
| protected Location | |
| protected int | |
| protected int | |
| protected boolean | |
| protected void | |
| protected byte | |
| protected int | |
| protected int | |
| protected void | |
| protected int | readQuotedValue(char[] outputBuffer, int quoteChar)
Implements abstract com.
|
| private void | |
| protected void | resolveStreamEncoding()
Method called to try to figure out physical encoding the underlying input stream uses. |
| protected void | |
| protected int | |
| protected void | |
| protected int | |
| protected void | |
| protected int | |
| private void | |
| private void | |
| protected String |
| mBigEndian | back to summary |
|---|---|
| pack-priv boolean mBigEndian | |
| mByteBuffer | back to summary |
|---|---|
| private byte[] mByteBuffer | |
| mByteSizeFound | back to summary |
|---|---|
| pack-priv boolean mByteSizeFound | |
| mBytesPerChar | back to summary |
|---|---|
| pack-priv int mBytesPerChar For most encodings, number of physical characters needed for decoding xml declaration characters (which for variable length encodings like UTF-8 will be 1). Exception is EBCDIC, which while a single-byte encoding, is denoted by -1 since it needs an additional translation lookup. | |
| mEBCDIC | back to summary |
|---|---|
| pack-priv boolean mEBCDIC Special case for 1-byte encodings: EBCDIC is problematic as it's not 7-bit ascii compatible. We can deal with it, still, but only with bit of extra state. | |
| mHadBOM | back to summary |
|---|---|
| pack-priv boolean mHadBOM | |
| mIn | back to summary |
|---|---|
| pack-priv final InputStream mIn Underlying InputStream to use for reading content. May be null if the actual data source is not stream-based but a block source. | |
| MIN_BUF_SIZE | back to summary |
|---|---|
| pack-priv static final int MIN_BUF_SIZE Let's size buffer at least big enough to contain the longest possible prefix of a document needed to positively identify it starts with the XML declaration. That means having (optional) BOM, and then first 6 characters ("<?xml "), in whatever encoding. With 4-byte encodings (UCS-4), that comes to 28 bytes. And for good measure, let's pad that a bit as well.... | |
| mInputEncoding | back to summary |
|---|---|
| pack-priv String mInputEncoding | |
| mInputEnd | back to summary |
|---|---|
| private int mInputEnd | |
| mInputPtr | back to summary |
|---|---|
| private int mInputPtr | |
| mRecycleBuffer | back to summary |
|---|---|
| private final boolean mRecycleBuffer Whether byte buffer is recyclable or not | |
| mSingleByteTranslation | back to summary |
|---|---|
| pack-priv int[] mSingleByteTranslation For single-byte non-ascii-compatible encodings (ok ok, really just EBCDIC), we'll have to use a lookup table. | |
| StreamBootstrapper | back to summary |
|---|---|
| private StreamBootstrapper(String pubId, SystemId sysId, InputStream in) | |
| StreamBootstrapper | back to summary |
|---|---|
private StreamBootstrapper(String pubId, SystemId sysId, byte[] data, int start, int end)
| |
| bootstrapInput | back to summary |
|---|---|
| public Reader bootstrapInput(ReaderConfig cfg, boolean mainDoc, int xmlVersion) throws IOException, XMLStreamException Implements abstract com.
| |
| checkKeyword | back to summary |
|---|---|
| protected int checkKeyword(String exp) throws IOException, WstxException Implements abstract com.
| |
| checkMbKeyword | back to summary |
|---|---|
protected int checkMbKeyword(String expected) throws IOException, WstxException
| |
| checkSbKeyword | back to summary |
|---|---|
protected int checkSbKeyword(String expected) throws IOException, WstxException
| |
| checkTranslatedKeyword | back to summary |
|---|---|
| protected int checkTranslatedKeyword(String expected) throws IOException, WstxException | |
| ensureLoaded | back to summary |
|---|---|
| protected boolean ensureLoaded(int minimum) throws IOException | |
| getInputColumn | back to summary |
|---|---|
| public int getInputColumn() Implements abstract com.
| |
| getInputEncoding | back to summary |
|---|---|
| public String getInputEncoding() Implements abstract com. Since this class only gets used when encoding is not explicitly passed, need use the encoding that was auto-detected...
| |
| getInputTotal | back to summary |
|---|---|
| public int getInputTotal() Implements abstract com.
| |
| getInstance | back to summary |
|---|---|
| public static StreamBootstrapper getInstance(String pubId, SystemId sysId, InputStream in) Factory method used when the underlying data provider is an actual stream. | |
| getInstance | back to summary |
|---|---|
| public static StreamBootstrapper getInstance(String pubId, SystemId sysId, byte[] data, int start, int end) Factory method used when the underlying data provider is a pre-allocated block source, and no stream is used. Additionally the buffer passed is not owned by the bootstrapper or Reader that is created, so it is not to be recycled. | |
| getLocation | back to summary |
|---|---|
| protected Location getLocation() Implements abstract com.
| |
| getNext | back to summary |
|---|---|
| protected int getNext() throws IOException, WstxException Implements abstract com.
| |
| getNextAfterWs | back to summary |
|---|---|
| protected int getNextAfterWs(boolean reqWs) throws IOException, WstxException Implements abstract com.
| |
| hasXmlDecl | back to summary |
|---|---|
| protected boolean hasXmlDecl() throws IOException, WstxException | |
| loadMore | back to summary |
|---|---|
| protected void loadMore() throws IOException, WstxException | |
| nextByte | back to summary |
|---|---|
| protected byte nextByte() throws IOException, WstxException | |
| nextMultiByte | back to summary |
|---|---|
| protected int nextMultiByte() throws IOException, WstxException | |
| nextTranslated | back to summary |
|---|---|
| protected int nextTranslated() throws IOException, WstxException | |
| pushback | back to summary |
|---|---|
| protected void pushback() Implements abstract com.
| |
| readQuotedValue | back to summary |
|---|---|
| protected int readQuotedValue(char[] outputBuffer, int quoteChar) throws IOException, WstxException Implements abstract com.
| |
| reportWeirdUCS4 | back to summary |
|---|---|
| private void reportWeirdUCS4(String type) throws IOException | |
| resolveStreamEncoding | back to summary |
|---|---|
| protected void resolveStreamEncoding() throws IOException, WstxException Method called to try to figure out physical encoding the underlying input stream uses. | |
| skipMbLF | back to summary |
|---|---|
| protected void skipMbLF(int lf) throws IOException, WstxException | |
| skipMbWs | back to summary |
|---|---|
| protected int skipMbWs() throws IOException, WstxException | |
| skipSbLF | back to summary |
|---|---|
| protected void skipSbLF(byte lfByte) throws IOException, WstxException | |
| skipSbWs | back to summary |
|---|---|
| protected int skipSbWs() throws IOException, WstxException | |
| skipTranslatedLF | back to summary |
|---|---|
| protected void skipTranslatedLF(int lf) throws IOException, WstxException | |
| skipTranslatedWs | back to summary |
|---|---|
| protected int skipTranslatedWs() throws IOException, WstxException | |
| verifyEncoding | back to summary |
|---|---|
| private void verifyEncoding(String id, int bpc) throws WstxException | |
| verifyEncoding | back to summary |
|---|---|
| private void verifyEncoding(String id, int bpc, boolean bigEndian) throws WstxException | |
| verifyXmlEncoding | back to summary |
|---|---|
protected String verifyXmlEncoding(String enc) throws WstxException
| |