Package java.io

Examples of java.io.BufferedInputStream.reset()


        {
            log.warn("Unsupported encoding.", e);
        }

        //Reset the bytes read
        is.reset();
        return new InputStreamReader(is, enc);
    }

    /**
     *
 
View Full Code Here


                // use a buffered input stream to find out whether there actually
                // is a request body
                InputStream bin = new BufferedInputStream(in);
                bin.mark(1);
                boolean isEmpty = -1 == bin.read();
                bin.reset();
                if (!isEmpty) {
                    requestDocument = DomUtil.parseDocument(bin);
                }
            }
        } catch (IOException e) {
View Full Code Here

                        {
                            charset = "UTF32-LE";
                        }
                        else
                        {
                            bufferedIn.reset();
                        }
                    }
                    else
                    {
                        bufferedIn.reset();
View Full Code Here

                            bufferedIn.reset();
                        }
                    }
                    else
                    {
                        bufferedIn.reset();
                    }
                }
            }
            // UTF-16 Big Endian BOM is FE FF
            else if (0xFE == (read & 0xFF))
View Full Code Here

                }
            }

            // If we didn't find a BOM, all bytes should contribute to the content
            if (!hasBOM)
                bufferedIn.reset();
        }

        BufferedReader reader = new BufferedReader(new InputStreamReader(bufferedIn, charset));
        int charactersRead = -1;
        while ((charactersRead = reader.read(tmp, 0, tmp.length)) >= 0)
View Full Code Here

    {
        BufferedInputStream bin = new BufferedInputStream(is);
        bin.mark(2);
        int b0 = bin.read();
        int b1 = bin.read();
        bin.reset();

        //Check for gzip magic number
        if ((b1 << 8 | b0) == GZIPInputStream.GZIP_MAGIC)
        {
            GZIPInputStream iis = new GZIPInputStream(bin);
View Full Code Here

                        return b;
                    }
                }
            }
            try {
                is.reset();
            } catch (IOException e) {
                is.close();
                is = new BufferedInputStream(new URL(bundleLocation).openStream());
            }
            return getBundleContext().installBundle(bundleLocation, is);
View Full Code Here

                        return b;
                    }
                }
            }
            try {
                is.reset();
            } catch (IOException e) {
                is.close();
                is = new BufferedInputStream(new URL(bundleLocation).openStream());
            }
            LOGGER.debug("Installing bundle " + bundleLocation);
View Full Code Here

        // No extensions present; the file ended where we expected.
        //
        break;
      }

      in.reset();
      md.update(hdr, 0, 8);
      IO.skipFully(in, 8);

      long sz = NB.decodeUInt32(hdr, 4);
      switch (NB.decodeInt32(hdr, 0)) {
View Full Code Here

    try {
      assertEquals("Hadoop20JHParser can't parse the test file", true,
          Hadoop20JHParser.canParse(inputLogStream));

      bis.reset();

      HistoryEvent event = parser.nextEvent();

      while (event != null) {
        printStream.println(event.getClass().getCanonicalName());
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.