Changeset 7396 for trunk/Res_Piccolo/com/bluecast/xml/XMLStreamReader.java
- Timestamp:
- 11/21/06 13:35:34 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Res_Piccolo/com/bluecast/xml/XMLStreamReader.java
r7316 r7396 68 68 * XML declaration. True will dish out the entire document. 69 69 */ 70 public XMLStreamReader (InputStream in , boolean rewindDeclaration) throws IOException70 public XMLStreamReader (InputStream in) throws IOException 71 71 { 72 this(in, null , rewindDeclaration);72 this(in, null); 73 73 } 74 74 … … 76 76 * Creates an XMLStreamReader while specifying a character encoding. 77 77 */ 78 public XMLStreamReader (InputStream in, String encoding, 79 boolean rewindDeclaration) throws IOException 78 public XMLStreamReader (InputStream in, String encoding) throws IOException 80 79 { 81 reset(in, encoding , rewindDeclaration);80 reset(in, encoding); 82 81 } 83 82 … … 85 84 * Reuses this XMLStreamReader for a different InputStream. 86 85 */ 87 public void reset (InputStream in, String encoding, 88 boolean rewindDeclaration) throws IOException { 86 public void reset (InputStream in, String encoding) throws IOException { 89 87 super.resetInput(); 90 88 this.in = in; 91 89 eofReached = false; 92 this.rewindDeclaration = rewindDeclaration;93 90 useDeclaredEncoding = false; 94 91 bbufPos = bbufEnd = 0; … … 675 672 676 673 int bbufPosTemp = bbufPos + decodeResult[0]; 677 cbufEnd= decodeResult[1];674 int cbufEndTemp = decodeResult[1]; 678 675 679 while(r == -2 && ! eofReached && cbufEnd < cbuf.length) {676 while(r == -2 && ! eofReached && cbufEndTemp < cbuf.length) { 680 677 fillByteBuffer(); 681 678 r = decoder.decodeXMLDecl(bbuf, bbufPosTemp, bbufEnd - bbufPosTemp, 682 cbuf, cbufPos+cbufEnd , cbuf.length-cbufEnd,679 cbuf, cbufPos+cbufEndTemp, cbuf.length-cbufEndTemp, 683 680 decodeResult); 684 681 bbufPosTemp += decodeResult[0]; 685 cbufEnd += decodeResult[1];686 } 687 688 int numCharsParsed = parseXMLDeclaration(cbuf,0,cbufEnd);682 cbufEndTemp += decodeResult[1]; 683 } 684 685 parseXMLDeclaration(cbuf,0,cbufEndTemp); 689 686 690 687 //if (numCharsParsed > 0) { … … 694 691 695 692 // Skip the XML declaration unless told otherwise 696 if (!rewindDeclaration)697 cbufPos += numCharsParsed;693 //if (!rewindDeclaration) 694 // cbufPos += numCharsParsed; 698 695 699 696 // If another encoding was specified, use it instead of the guess. … … 702 699 && !declaredEncoding.equalsIgnoreCase(encoding)) { 703 700 704 cbufPos = cbufEnd = 0; 701 cbufPos = cbufEndTemp = 0; 702 bbufPos = initialBBufPos; 705 703 decoder.reset(); 706 707 708 if (rewindDeclaration)709 bbufPos = initialBBufPos;710 else711 bbufPos = numCharsParsed*minBytesPerChar;712 704 713 705 setEncoding(declaredEncoding);
Note: See TracChangeset
for help on using the changeset viewer.