Examples of unread()


Examples of java.io.PushbackInputStream.unread()

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

            pis.unread(tag);

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

Examples of java.io.PushbackInputStream.unread()

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

            pis.unread(tag);

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

Examples of java.io.PushbackInputStream.unread()

        try {
            PushbackInputStream pin =
                new PushbackInputStream(connection.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()

        try {
            PushbackInputStream pin =
                new PushbackInputStream(connection.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()

        try {
            PushbackInputStream pin =
                new PushbackInputStream(connection.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()

        //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 = new String(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

Examples of java.io.PushbackInputStream.unread()

    public ConfigurationData readConfigurationData(InputStream in) throws IOException, ClassNotFoundException {
        PushbackInputStream pushbackInputStream = new PushbackInputStream(in, 2);
        byte[] streamHeader = new byte[2];
        if (pushbackInputStream.read(streamHeader) != 2) throw new AssertionError("Cound not read stream header");
        pushbackInputStream.unread(streamHeader);

        // if this isn't a serialized config, fallback to the xstream marshaler
        if (SERIALIZED_MAGIC[0] != streamHeader[0] || SERIALIZED_MAGIC[1] != streamHeader[1]) {
            ConfigurationMarshaler marshaler;
            try {
View Full Code Here

Examples of java.io.PushbackInputStream.unread()

    public ConfigurationData readConfigurationData(InputStream in) throws IOException, ClassNotFoundException {
        PushbackInputStream pushbackInputStream = new PushbackInputStream(in, 2);
        byte[] streamHeader = new byte[2];
        if (pushbackInputStream.read(streamHeader) != 2) throw new AssertionError("Cound not read stream header");
        pushbackInputStream.unread(streamHeader);

        // if this is a serialized config, fallback to the serialization marshaler
        if (SERIALIZED_MAGIC[0] == streamHeader[0] && SERIALIZED_MAGIC[1] == streamHeader[1]) {
            return new SerializedConfigurationMarshaler().readConfigurationData(pushbackInputStream);
        }
View Full Code Here

Examples of java.io.PushbackInputStream.unread()

    public ConfigurationData readConfigurationData(InputStream in) throws IOException, ClassNotFoundException {
        PushbackInputStream pushbackInputStream = new PushbackInputStream(in, 2);
        byte[] streamHeader = new byte[2];
        if (pushbackInputStream.read(streamHeader) != 2) throw new AssertionError("Cound not read stream header");
        pushbackInputStream.unread(streamHeader);

        // if this isn't a serialized config, fallback to the xstream marshaler
        if (SERIALIZED_MAGIC[0] != streamHeader[0] || SERIALIZED_MAGIC[1] != streamHeader[1]) {
            ConfigurationMarshaler marshaler;
            try {
View Full Code Here

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
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.