Package java.io

Examples of java.io.ByteArrayInputStream.reset()


    try {
      WordExtractor docextractor = new WordExtractor(is);
      ret = docextractor.getText();
    } catch (OldWordFileFormatException e) {
      try {
        is.reset();
        Word6Extractor docextractor = new Word6Extractor(is);
        ret = docextractor.getText();
      } catch (IOException e1) {
        throw new CRException(e1);
      }
View Full Code Here


            InputStream in = new ByteArrayInputStream(out.toByteArray());

            // should not cause SecurityException
            new ObjectInputStream(in);
            in.reset();

            // should not cause SecurityException
            new ObjectInputStream(in) {};
            in.reset();
View Full Code Here

            new ObjectInputStream(in);
            in.reset();

            // should not cause SecurityException
            new ObjectInputStream(in) {};
            in.reset();

            try {
                new ObjectInputStream(in) {
                    @Override
                    public Object readUnshared() throws IOException, ClassNotFoundException {
View Full Code Here

                fail("should throw SecurityException 1");
            } catch (SecurityException e) {
                // Expected
            }

            in.reset();
            try {
                new ObjectInputStream(in) {
                    @Override
                    public GetField readFields() throws IOException,
                            ClassNotFoundException, NotActiveException {
View Full Code Here

            InputStream in = new ByteArrayInputStream(out.toByteArray());

            // should not cause SecurityException
            new ObjectInputStream(in);
            in.reset();

            // should not cause SecurityException
            new ObjectInputStream(in) {};
            in.reset();
View Full Code Here

            new ObjectInputStream(in);
            in.reset();

            // should not cause SecurityException
            new ObjectInputStream(in) {};
            in.reset();

            try {
                new ObjectInputStream(in) {
                    public Object readUnshared() throws IOException, ClassNotFoundException {
                        return null;
View Full Code Here

                    }
                };
                fail("should throw SecurityException 1");
            } catch (SecurityException e) {}

            in.reset();
            try {
                new ObjectInputStream(in) {
                    public GetField readFields() throws IOException,
                            ClassNotFoundException, NotActiveException {
                        return null;
View Full Code Here

    final ByteArrayInputStream stream = new ByteArrayInputStream(data);
    if (isGIF(stream))
    {
      return "image/gif";
    }
    stream.reset();
    if (isJPEG(stream))
    {
      return "image/jpeg";
    }
    stream.reset();
View Full Code Here

    stream.reset();
    if (isJPEG(stream))
    {
      return "image/jpeg";
    }
    stream.reset();
    if (isPNG(stream))
    {
      return "image/png";
    }
    return null;
View Full Code Here

                decompress(encoded, baos);
                ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
                Predictor.decodePredictor(predictor, colors, bitsPerPixel, columns, bais, decoded);
                decoded.flush();
                baos.reset();
                bais.reset();
            }
            else
            {
                decompress(encoded, decoded);
            }
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.