/** * Peek a fixed number of characters from the input source. * <p/> * Peek differs from {@link #read(int)} in that it leaves the * characters in the segment buffer. * * @param numChars The number of characters to peeked. * @return The characters in a String. If the end of the input source * was reached, the length of the string will be less than the requested number * of characters. * @throws IOException Error reading from input source. */ public String peek(int numChars) throws IOException { return peek(numChars, false); }
/** * Peek a fixed number of characters from the input source. * <p/> * Peek differs from {@link #read(int)} in that it leaves the * characters in the segment buffer. * * @param numChars The number of characters to peeked. * @return The characters in a String. If the end of the input source * was reached, the length of the string will be less than the requested number * of characters. * @throws IOException Error reading from input source. */ public String peek(int numChars) throws IOException { return peek(numChars, false); }
/** * Peek a fixed number of characters from the input source. * * Peek differs from {@link #read(int)} in that it leaves the * characters in the segment buffer. * * @param numChars The number of characters to peeked. * @return The characters in a String. If the end of the input source * was reached, the length of the string will be less than the requested number * of characters. * @throws IOException Error reading from input source. */ public String peek(int numChars) throws IOException { return peek(numChars, false); }
/** * Peek a fixed number of characters from the input source. * <p/> * Peek differs from {@link #read(int)} in that it leaves the * characters in the segment buffer. * * @param numChars The number of characters to peeked. * @return The characters in a String. If the end of the input source * was reached, the length of the string will be less than the requested number * of characters. * @throws IOException Error reading from input source. */ public String peek(int numChars) throws IOException { return peek(numChars, false); }
/** * Read a fixed number of characters from the input source. * @param numChars The number of characters to read. * @return The characters in a String. If the end of the input source * was reached, the length of the string will be less than the requested number * of characters. * @throws IOException Error reading from input source. */ public String read(int numChars) throws IOException { segmentBuffer.setLength(0); try { return peek(numChars); } finally { segmentBuffer.setLength(0); } }
/** * Read a fixed number of characters from the input source. * @param numChars The number of characters to read. * @return The characters in a String. If the end of the input source * was reached, the length of the string will be less than the requested number * of characters. * @throws IOException Error reading from input source. */ public String read(int numChars) throws IOException { segmentBuffer.setLength(0); try { return peek(numChars); } finally { segmentBuffer.setLength(0); } }
/** * Read a fixed number of characters from the input source. * @param numChars The number of characters to read. * @return The characters in a String. If the end of the input source * was reached, the length of the string will be less than the requested number * of characters. * @throws IOException Error reading from input source. */ public String read(int numChars) throws IOException { segmentBuffer.setLength(0); try { return peek(numChars); } finally { segmentBuffer.setLength(0); } }
/** * Read a fixed number of characters from the input source. * @param numChars The number of characters to read. * @return The characters in a String. If the end of the input source * was reached, the length of the string will be less than the requested number * of characters. * @throws IOException Error reading from input source. */ public String read(int numChars) throws IOException { segmentBuffer.setLength(0); try { return peek(numChars); } finally { segmentBuffer.setLength(0); } }
public void process(InterchangeContext interchangeContext) throws IOException, SAXException { BufferedSegmentReader segmentReader = interchangeContext.getSegmentReader(); interchangeContext.getControlSegmentParser().startElement("group", ungSegment.getNamespace(), true); segmentReader.moveToNextSegment(false); interchangeContext.mapControlSegment(ungSegment, true); while(true) { String segCode = segmentReader.peek(3, true); if(segCode.equals("UNE")) { segmentReader.moveToNextSegment(false); interchangeContext.mapControlSegment(uneSegment, true); break; } else if(segCode.length() > 0) { ControlBlockHandler handler = interchangeContext.getControlBlockHandler(segCode); handler.process(interchangeContext); } else { throw new EDIParseException("Unexpected end of UN/EDIFACT data stream. If stream was reset (e.g. after read charset was changed), please make sure underlying stream was properly reset."); } } interchangeContext.getControlSegmentParser().endElement("group", ungSegment.getNamespace(), true); } }
public void process(InterchangeContext interchangeContext) throws IOException, SAXException { BufferedSegmentReader segmentReader = interchangeContext.getSegmentReader(); interchangeContext.getControlSegmentParser().startElement("group", ungSegment.getNamespace(), true); segmentReader.moveToNextSegment(false); interchangeContext.mapControlSegment(ungSegment, true); while(true) { String segCode = segmentReader.peek(3, true); if(segCode.equals("UNE")) { segmentReader.moveToNextSegment(false); interchangeContext.mapControlSegment(uneSegment, true); break; } else if(segCode.length() > 0) { ControlBlockHandler handler = interchangeContext.getControlBlockHandler(segCode); handler.process(interchangeContext); } else { throw new EDIParseException("Unexpected end of UN/EDIFACT data stream. If stream was reset (e.g. after read charset was changed), please make sure underlying stream was properly reset."); } } interchangeContext.getControlSegmentParser().endElement("group", ungSegment.getNamespace(), true); } }
public void process(InterchangeContext interchangeContext) throws IOException, SAXException { BufferedSegmentReader segmentReader = interchangeContext.getSegmentReader(); interchangeContext.getControlSegmentParser().startElement("group", ungSegment.getNamespace(), true); segmentReader.moveToNextSegment(false); interchangeContext.mapControlSegment(ungSegment, true); while(true) { String segCode = segmentReader.peek(3, true); if(segCode.equals("UNE")) { segmentReader.moveToNextSegment(false); interchangeContext.mapControlSegment(uneSegment, true); break; } else if(segCode.length() > 0) { ControlBlockHandler handler = interchangeContext.getControlBlockHandler(segCode); handler.process(interchangeContext); } else { throw new EDIParseException("Unexpected end of UN/EDIFACT data stream. If stream was reset (e.g. after read charset was changed), please make sure underlying stream was properly reset."); } } interchangeContext.getControlSegmentParser().endElement("group", ungSegment.getNamespace(), true); } }
public void process(InterchangeContext interchangeContext) throws IOException, SAXException { BufferedSegmentReader segmentReader = interchangeContext.getSegmentReader(); interchangeContext.getControlSegmentParser().startElement("group", ungSegment.getNamespace(), true); segmentReader.moveToNextSegment(false); interchangeContext.mapControlSegment(ungSegment, true); while(true) { String segCode = segmentReader.peek(3, true); if(segCode.equals("UNE")) { segmentReader.moveToNextSegment(false); interchangeContext.mapControlSegment(uneSegment, true); break; } else if(segCode.length() > 0) { ControlBlockHandler handler = interchangeContext.getControlBlockHandler(segCode); handler.process(interchangeContext); } else { throw new EDIParseException("Unexpected end of UN/EDIFACT data stream. If stream was reset (e.g. after read charset was changed), please make sure underlying stream was properly reset."); } } interchangeContext.getControlSegmentParser().endElement("group", ungSegment.getNamespace(), true); } }
segCode = segmentReader.peek(3, true); if(segCode.length() == 3) { interchangeContext = createInterchangeContext(segmentReader, validate, handlerFactory, namespaceDeclarationStack);
segCode = segmentReader.peek(3, true); if(segCode.length() == 3) { interchangeContext = createInterchangeContext(segmentReader, validate, handlerFactory, namespaceDeclarationStack);
segCode = segmentReader.peek(3, true); if(segCode.length() == 3) { interchangeContext = createInterchangeContext(segmentReader, validate, handlerFactory, namespaceDeclarationStack);
segCode = segmentReader.peek(3, true); if(segCode.length() == 3) { interchangeContext = createInterchangeContext(segmentReader, validate, handlerFactory, namespaceDeclarationStack);
String segCode = segmentReader.peek(3, true);
String segCode = segmentReader.peek(3, true);
String segCode = segmentReader.peek(3, true);
String segCode = segmentReader.peek(3, true);