Package java.io

Examples of java.io.PushbackInputStream.unread()


// System.out.println("receiving HTTP/0.9 response");
    PushbackInputStream pin = new PushbackInputStream(hs.in,
      status.length() + 4);

    pin.unread('\n');
    pin.unread('\r');
    for (int i = status.length(); --i >= 0; ) {
        pin.unread(status.charAt(i));
    }
View Full Code Here


// System.out.println("receiving HTTP/0.9 response");
    PushbackInputStream pin = new PushbackInputStream(hs.in,
      status.length() + 4);

    pin.unread('\n');
    pin.unread('\r');
    for (int i = status.length(); --i >= 0; ) {
        pin.unread(status.charAt(i));
    }

    /*
 
View Full Code Here

      status.length() + 4);

    pin.unread('\n');
    pin.unread('\r');
    for (int i = status.length(); --i >= 0; ) {
        pin.unread(status.charAt(i));
    }

    /*
     * And push back a blank line, so the user thinks it got to
     * the end of the headers
View Full Code Here

    /*
     * And push back a blank line, so the user thinks it got to
     * the end of the headers
     */
    pin.unread('\n');
    pin.unread('\r');

    status = "HTTP/1.0 200 OK";
    hs.in = pin;
    under = pin;
View Full Code Here

    /*
     * And push back a blank line, so the user thinks it got to
     * the end of the headers
     */
    pin.unread('\n');
    pin.unread('\r');

    status = "HTTP/1.0 200 OK";
    hs.in = pin;
    under = pin;
    in = new HttpInputStream(under);
View Full Code Here

    int pushBackBufferSize = 2;
    PushbackInputStream in = new PushbackInputStream(file.getContent().getInputStream(),
        pushBackBufferSize);
    int b1 = in.read();
    int b2 = in.read();
    in.unread(b2);
    in.unread(b1);
    if(b1 == GzFileConnection.GZIP_MAGIC_BYTE1 && b2 == GzFileConnection.GZIP_MAGIC_BYTE2) {
      return new GZIPInputStream(in);
    } else {
      return in;
View Full Code Here

    PushbackInputStream in = new PushbackInputStream(file.getContent().getInputStream(),
        pushBackBufferSize);
    int b1 = in.read();
    int b2 = in.read();
    in.unread(b2);
    in.unread(b1);
    if(b1 == GzFileConnection.GZIP_MAGIC_BYTE1 && b2 == GzFileConnection.GZIP_MAGIC_BYTE2) {
      return new GZIPInputStream(in);
    } else {
      return in;
    }
View Full Code Here

            if (tag == -1)
            {
                return null;
            }

            pis.unread(tag);

            if (tag != 0x30// assume ascii PEM encoded.
            {
                return readPEMCertificate(pis);
            }
View Full Code Here

            if (tag == -1)
            {
                return null;
            }

            pis.unread(tag);

            if (tag != 0x30// assume ascii PEM encoded.
            {
                return readPEMCRL(pis);
            }
View Full Code Here

        //boundary should definitely be in the first 2K;
        PushbackInputStream in = new PushbackInputStream(is, 4096);
        byte buf[] = new byte[2048];
        int i = in.read(buf);
        String msg = IOUtils.newStringFromBytes(buf, 0, i);
        in.unread(buf, 0, i);
       
        // Reset the input stream since we'll need it again later
        message.setContent(InputStream.class, in);

        // Use regex to get the boundary and return null if it's not found
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.