Examples of StreamReader


Examples of limelight.io.StreamReader

    checkSettingImageDataWith("star.wbm");
  }

  private void checkSettingImageDataWith(String imageFile) throws Exception
  {
    StreamReader reader = new StreamReader(TestUtil.fs.inputStream(TestUtil.dataDirPath(imageFile)));
    byte[] bytes = reader.readBytes(100000);

    panel.setData(bytes);

    assertEquals(200, panel.getImage().getHeight(null));
    assertEquals(200, panel.getImage().getWidth(null));
View Full Code Here

Examples of limelight.io.StreamReader

  }

  public static void writeSamplePlayerTo(OutputStream outputStream) throws IOException
  {
    final String playerClassFile = TestUtil.dataDirPath("SamplePlayer.class");
    StreamReader reader = new StreamReader(TestUtil.fs.inputStream(playerClassFile));
    final byte[] classBytes = reader.readAllBytes();
    reader.close();
    outputStream.write(classBytes);
    outputStream.close();
  }
View Full Code Here

Examples of limelight.io.StreamReader

  protected Class<?> findClass(String name) throws ClassNotFoundException
  {
    String path = classpath + "/" + name.replace('.', '/') + ".class";
    if(Context.fs().exists(path))
    {
      StreamReader reader = new StreamReader(Context.fs().inputStream(path));
      byte[] classBytes = reader.readAllBytes();
      reader.close();
      return defineClass(name, classBytes, 0, classBytes.length);
    }
    else
      throw new ClassNotFoundException(name);
  }
View Full Code Here

Examples of net.buffalo.protocal.io.StreamReader

 
  public void testUnmarshallingBigDecimal() throws Exception {
    StringReader reader = new StringReader("<buffalo-call><map><type>java.math.BigDecimal</type>" +
        "<string>value</string>" +
        "<string>123.456</string></map></buffalo-call>");
    StreamReader streamReader = new FastStreamReader(reader);
    unmarshallingContext = new DefaultUnmarshallingContext(new DefaultConverterLookup(), streamReader);
    BigDecimal number = (BigDecimal) unmarshallingContext.convertAnother();
    assertEquals(new BigDecimal("123.456"), number);
  }
View Full Code Here

Examples of org.jpedal.jbig2.io.StreamReader

  public void setGlobalData(byte[] data) {
    globalData = data;
  }

  public void decodeJBIG2(byte[] data) throws IOException, JBIG2Exception {
    reader = new StreamReader(data);

    resetDecoder();

    boolean validFile = checkHeader();
    if (JBIG2StreamDecoder.debug)
      System.out.println("validFile = " + validFile);

    if (!validFile) {
      /**
       * Assume this is a stream from a PDF so there is no file header,
       * end of page segments, or end of file segments. Organisation must
       * be sequential, and the number of pages is assumed to be 1.
       */

      noOfPagesKnown = true;
      randomAccessOrganisation = false;
      noOfPages = 1;

      /** check to see if there is any global data to be read */
      if (globalData != null) {
        /** set the reader to read from the global data */
        reader = new StreamReader(globalData);

        huffmanDecoder = new HuffmanDecoder(reader);
        mmrDecoder = new MMRDecoder(reader);
        arithmeticDecoder = new ArithmeticDecoder(reader);
       
        /** read in the global data segments */
        readSegments();

        /** set the reader back to the main data */
        reader = new StreamReader(data);
      } else {
        /**
         * There's no global data, so move the file pointer back to the
         * start of the stream
         */
 
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

    @JRubyMethod
    public IRubyObject parse(ThreadContext context, IRubyObject target) {
        Ruby runtime = context.runtime;
       
        // FIXME? only supports Unicode, since we have to produces strings...
        StreamReader reader;
        if (target.respondsTo("read")) {
            reader = new StreamReader(new InputStreamReader(new IOInputStream(target)));
        } else {
            reader = new StreamReader(new StringReader(target.convertToString().asJavaString()));
        }
        Parser parser = new ParserImpl(reader);
        IRubyObject handler = getInstanceVariable("@handler");
        Event event;
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

            Charset charset = byteList.getEncoding().getCharset();
            if (charset == null) charset = Charset.defaultCharset();

            InputStreamReader isr = new InputStreamReader(bais, charset);

            return new StreamReader(isr);
        }

        // fall back on IOInputStream, using default charset
        if (yaml.respondsTo("read")) {
            return new StreamReader(new InputStreamReader(new IOInputStream(yaml), Charset.defaultCharset()));
        } else {
            throw runtime.newTypeError(yaml, runtime.getIO());
        }
    }
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

    private Object construct(String data) {
        return construct(new Constructor(), data);
    }

    private Object construct(Constructor constructor, String data) {
        StreamReader reader = new StreamReader(data);
        Parser parser = new ParserImpl(reader);
        Resolver resolver = new Resolver();
        Composer composer = new Composer(parser, resolver);
        constructor.setComposer(composer);
        return constructor.getSingleData(Object.class);
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

        return construct(new Constructor(), data);
    }

    @SuppressWarnings("unchecked")
    private List<Object> construct(Constructor constructor, String data) {
        StreamReader reader = new StreamReader(data);
        Parser parser = new ParserImpl(reader);
        Resolver resolver = new Resolver();
        Composer composer = new Composer(parser, resolver);
        constructor.setComposer(composer);
        List<Object> result = (List<Object>) constructor.getSingleData(Object.class);
View Full Code Here

Examples of org.yaml.snakeyaml.reader.StreamReader

            }
        }
    }

    private List<Node> compose_all(InputStream file) {
        Composer composer = new Composer(new ParserImpl(new StreamReader(new UnicodeReader(file))),
                new Resolver());
        List<Node> documents = new ArrayList<Node>();
        while (composer.checkNode()) {
            documents.add(composer.getNode());
        }
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.