Package java.io

Examples of java.io.BufferedInputStream.reset()


        if (head != 0x30)
        {
            throw new IOException("stream does not represent a PKCS12 key store");
        }

        bufIn.reset();

        ASN1InputStream bIn = new ASN1InputStream(bufIn);
        ASN1Sequence obj = (ASN1Sequence)bIn.readObject();
        Pfx bag = Pfx.getInstance(obj);
        ContentInfo info = bag.getAuthSafe();
View Full Code Here


      try {
        Charset charset;
        int[] sig = new int[] { buffered.read(), buffered.read(), buffered.read(), buffered.read() };
        // Encoding detection based on http://www.ietf.org/rfc/rfc4627.txt
        if (sig[0] == 0xEF && sig[1] == 0xBB && sig[2] == 0xBF) {
          buffered.reset();
          buffered.read();
          buffered.read();
          buffered.read();
          return new JsonParser(true, lazyNumbers, new PseudoUtf8Reader(buffered)).parse(clazz);
        } else if (sig[0] == 0x00 && sig[1] == 0x00 && sig[2] == 0xFE && sig[3] == 0xFF) {
View Full Code Here

          charset = Charset.forName("UTF-32BE");
        } else if (sig[0] == 0xFF && sig[1] == 0xFE && sig[2] == 0x00 && sig[3] == 0x00) {
          charset = Charset.forName("UTF-32LE");
        } else if (sig[0] == 0xFE && sig[1] == 0xFF) {
          charset = Charset.forName("UTF-16BE");
          buffered.reset();
          buffered.read();
          buffered.read();
        } else if (sig[0] == 0xFF && sig[1] == 0xFE) {
          charset = Charset.forName("UTF-16LE");
          buffered.reset();
View Full Code Here

          buffered.reset();
          buffered.read();
          buffered.read();
        } else if (sig[0] == 0xFF && sig[1] == 0xFE) {
          charset = Charset.forName("UTF-16LE");
          buffered.reset();
          buffered.read();
          buffered.read();
        } else if (sig[0] == 0 && sig[1] == 0 && sig[2] == 0 && sig[3] != 0) {
          charset = Charset.forName("UTF-32BE");
          buffered.reset();
View Full Code Here

          buffered.reset();
          buffered.read();
          buffered.read();
        } else if (sig[0] == 0 && sig[1] == 0 && sig[2] == 0 && sig[3] != 0) {
          charset = Charset.forName("UTF-32BE");
          buffered.reset();
        } else if (sig[0] != 0 && sig[1] == 0 && sig[2] == 0 && sig[3] == 0) {
          charset = Charset.forName("UTF-32LE");
          buffered.reset();
        } else if (sig[0] == 0 && sig[1] != 0 && sig[2] == 0 && sig[3] != 0) {
          charset = Charset.forName("UTF-16BE");
View Full Code Here

        } else if (sig[0] == 0 && sig[1] == 0 && sig[2] == 0 && sig[3] != 0) {
          charset = Charset.forName("UTF-32BE");
          buffered.reset();
        } else if (sig[0] != 0 && sig[1] == 0 && sig[2] == 0 && sig[3] == 0) {
          charset = Charset.forName("UTF-32LE");
          buffered.reset();
        } else if (sig[0] == 0 && sig[1] != 0 && sig[2] == 0 && sig[3] != 0) {
          charset = Charset.forName("UTF-16BE");
          buffered.reset();
        } else if (sig[0] != 0 && sig[1] == 0 && sig[2] != 0 && sig[3] == 0) {
          charset = Charset.forName("UTF-16LE");
View Full Code Here

        } else if (sig[0] != 0 && sig[1] == 0 && sig[2] == 0 && sig[3] == 0) {
          charset = Charset.forName("UTF-32LE");
          buffered.reset();
        } else if (sig[0] == 0 && sig[1] != 0 && sig[2] == 0 && sig[3] != 0) {
          charset = Charset.forName("UTF-16BE");
          buffered.reset();
        } else if (sig[0] != 0 && sig[1] == 0 && sig[2] != 0 && sig[3] == 0) {
          charset = Charset.forName("UTF-16LE");
          buffered.reset();
        } else {
          buffered.reset();
View Full Code Here

        } else if (sig[0] == 0 && sig[1] != 0 && sig[2] == 0 && sig[3] != 0) {
          charset = Charset.forName("UTF-16BE");
          buffered.reset();
        } else if (sig[0] != 0 && sig[1] == 0 && sig[2] != 0 && sig[3] == 0) {
          charset = Charset.forName("UTF-16LE");
          buffered.reset();
        } else {
          buffered.reset();
          return new JsonParser(true, lazyNumbers, new PseudoUtf8Reader(buffered)).parse(clazz);
        }
View Full Code Here

          buffered.reset();
        } else if (sig[0] != 0 && sig[1] == 0 && sig[2] != 0 && sig[3] == 0) {
          charset = Charset.forName("UTF-16LE");
          buffered.reset();
        } else {
          buffered.reset();
          return new JsonParser(true, lazyNumbers, new PseudoUtf8Reader(buffered)).parse(clazz);
        }

        return new JsonParser(false, lazyNumbers, new InputStreamReader(buffered, charset)).parse(clazz);
      } catch (IOException e) {
View Full Code Here

                os.write(lineFeed);
                os.flush();
                readAck(is, false);

                // now send the stream
                buffer.reset();
                while ((read = buffer.read(reply)) != -1) {
                    os.write(reply, 0, read);
                }
                writeAck(os);
                readAck(is, false);
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.