Examples of unread()


Examples of java.io.PushbackInputStream.unread()

            if ((bb & 0xFF) == lcbr) { //multi
                if (transferUntil(pis, keyStream, mClose)) { //close tag
                    //multi_key =  "_" + keyStream.toString(); //for _Key
                    bb = pis.read();
                    if ((bb & 0xFF) != 10){ //kill newline
                        pis.unread(bb);
                    }
                    multi_key = keyStream.toByteArray(); //IMPORTANT: no prefix here
                    keyStream.reset(); //reset stream

                    //this needs multi_key without prefix
View Full Code Here

Examples of java.io.PushbackInputStream.unread()

                    //this needs multi_key without prefix
                    if (transferUntil(pis, keyStream, appendBytes(mOpen, slashChar, multi_key, mClose))){
                        bb = pis.read();
                        if((bb & 0xFF) != 10){ //kill newline
                            pis.unread(bb);
                        }

                        final byte[] text=keyStream.toByteArray(); //text between #{key}# an #{/key}#
                        int num=0;
                        final String patternKey = getPatternKey(prefix, multi_key);
View Full Code Here

Examples of java.io.PushbackInputStream.unread()

                    //          ")");
                    out.write( node.getCode() );
                    buffer.reset();
                }

                input.unread( nextByte );
            }
            else
            {
                //log.debug("encode - EOF on lookahead: writing node, resetting buffer, and terminating read loop (" +
                //          " node.getCode: " + node.getCode() + ")" +
View Full Code Here

Examples of java.io.PushbackInputStream.unread()

                //log.debug("encode - Clearing dictionary and unreading pending buffer data (" +
                //          " bitsInChunk: " + out.getBitsInChunk() +
                //          ")");
                out.write( CLEAR_TABLE );
                dic = new LZWDictionary();
                input.unread( buffer.toByteArray() );
                buffer.reset();
            }
        }

        // Fix the code size based on the fact that we are writing the EOD
View Full Code Here

Examples of java.io.PushbackInputStream.unread()

      byte[] header = new byte[3];
      int len = pis.read(header, 0, 3);
      if (len < 1)
        return in;
      if (header[0] != UTF_BOM[0] || header[1] != UTF_BOM[1] || header[2] != UTF_BOM[2]) {
        pis.unread(header, 0, len);
      }
      return pis;
    }
    catch (IOException e) {
      throw Lang.wrapThrow(e);
View Full Code Here

Examples of java.io.PushbackInputStream.unread()

                messageContext.setProperty(BaseConstants.FAULT_MESSAGE, SynapseConstants.TRUE);
                if (log.isDebugEnabled()) {
                    log.debug("Hessian fault detected, marking in Axis2 message context");
                }
            }
            pis.unread(headerBytes);
        } else if (n > 0) {
                byte[] bytesRead = new byte[n];
                System.arraycopy(headerBytes, 0, bytesRead, 0, n);
                pis.unread(bytesRead);
        }
View Full Code Here

Examples of java.io.PushbackInputStream.unread()

            }
            pis.unread(headerBytes);
        } else if (n > 0) {
                byte[] bytesRead = new byte[n];
                System.arraycopy(headerBytes, 0, bytesRead, 0, n);
                pis.unread(bytesRead);
        }
        return pis;
    }
}
View Full Code Here

Examples of java.io.PushbackInputStream.unread()

        LongField signature = new LongField(HeaderBlockConstants._signature_offset, header);

        // Wind back those 8 bytes
        if(inp instanceof PushbackInputStream) {
            PushbackInputStream pin = (PushbackInputStream)inp;
            pin.unread(header);
        } else {
            inp.reset();
        }

        // Did it match the signature?
View Full Code Here

Examples of java.io.PushbackInputStream.unread()

                        @SuppressWarnings("resource")
                        PushbackInputStream pin =
                            new PushbackInputStream(getInputStream());
                        int c = pin.read();
                        if (c != -1) {
                            pin.unread((byte)c);
                            in = pin;
                        }
                    } catch (IOException ioe) {
                        // ignore
                    }   
View Full Code Here

Examples of java.io.PushbackInputStream.unread()

                    // push back stream to be the source of the data input obj.
                    final int surplus = read - hdrInfo.headerLength();
                    FormatIdInputStream formatIn = (FormatIdInputStream)in;
                    PushbackInputStream pushbackIn = new PushbackInputStream(
                            formatIn.getInputStream(), surplus);
                    pushbackIn.unread(header, hdrInfo.headerLength(), surplus);
                    formatIn.setInput(pushbackIn);
                } else {
                    // 3) Assume we have a store stream.
                    rewindStream(srcIn, hdrInfo.headerLength());
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.