Package java.io

Examples of java.io.ByteArrayInputStream.skip()


        Class<?> messageType = factoryArray.get(messageTypeIndex);
        tmp = (Message) messageType.newInstance();
        tmp.setProtocolVersion(networkProtocolVersion);
        ByteArrayInputStream in = new ByteArrayInputStream(data);
        if (offset > 0) {
          in.skip(offset);
        }
        InputSerializer s = new InputSerializer(in);
        s.setProtocolVersion(networkProtocolVersion);

        tmp.readObject(s);
View Full Code Here


        results.setCaretPosition(0);
        byte[] source = res.getResponseData();
        final ByteArrayInputStream baIS = new ByteArrayInputStream(source);
        for(int i=0; i<source.length-XML_PFX.length; i++){
            if (JOrphanUtils.startsWith(source, XML_PFX, i)){
                baIS.skip(i);// Skip the leading bytes (if any)
                break;
            }
        }

        // there is also a javax.swing.text.Document class.
View Full Code Here

      if (bd.getClass() != DirectBinaryDecoder.class) {
        throw e;
      }
    }
    bd.readFloat(); // use data, and otherwise trigger buffer fill
    check.skip(4); // skip the same # of bytes here
    validateInputStreamReads(test, check);
  }

  private void validateInputStreamReads(InputStream test, InputStream check)
      throws IOException {
View Full Code Here

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            InputStream is = new ByteArrayInputStream( rawdata );
            Header header = new Header();
            header.read(rawdata, CHECKSUM_SIZE);
            is.skip(header.getSize() + CHECKSUM_SIZE);

            InflaterInputStream inflater = new InflaterInputStream( is );
            byte[] chunk = new byte[4096];
            int count;
            while ((count = inflater.read(chunk)) >=0 ) {
View Full Code Here

      if (bd.getClass() != DirectBinaryDecoder.class) {
        throw e;
      }
    }
    bd.readFloat(); // use data, and otherwise trigger buffer fill
    check.skip(4); // skip the same # of bytes here
    validateInputStreamReads(test, check);
  }

  private void validateInputStreamReads(InputStream test, InputStream check)
      throws IOException {
View Full Code Here

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            InputStream is = new ByteArrayInputStream( rawdata );
            Header header = new Header();
            header.read(rawdata, CHECKSUM_SIZE);
            is.skip(header.getSize() + CHECKSUM_SIZE);

            InflaterInputStream inflater = new InflaterInputStream( is );
            byte[] chunk = new byte[4096];
            int count;
            while ((count = inflater.read(chunk)) >=0 ) {
View Full Code Here

        results.setCaretPosition(0);
        byte[] source = res.getResponseData();
        final ByteArrayInputStream baIS = new ByteArrayInputStream(source);
        for(int i=0; i<source.length-XML_PFX.length; i++){
            if (JOrphanUtils.startsWith(source, XML_PFX, i)){
                baIS.skip(i);// Skip the leading bytes (if any)
                break;
            }
        }

        // there is also a javax.swing.text.Document class.
View Full Code Here

   
        // Convert listing to bytes
        byte[] retBytes = new byte[length];
        byte[] metBytes = urlListing.getBytes();     
        ByteArrayInputStream is = new ByteArrayInputStream(metBytes);
        is.skip(offset);
        is.read(retBytes, 0, length);
       
        return retBytes;
  }
View Full Code Here

    results.setCaretPosition(0);
    byte[] source = res.getResponseData();
        final ByteArrayInputStream baIS = new ByteArrayInputStream(source);
      for(int i=0; i<source.length-XML_PFX.length; i++){
          if (JOrphanUtils.startsWith(source, XML_PFX, i)){
              baIS.skip(i);// Skip the leading bytes (if any)
              break;
          }
      }
    Component view = results;
View Full Code Here

        ByteArrayInputStream bais = new ByteArrayInputStream(buf);
        for (int i = 0; i < numGlyphs; i++) {
            int len = loca.getOffset((short)(i + 1)) - loca.getOffset(i);
            if (len > 0) {
                bais.reset();
                bais.skip(loca.getOffset(i));
                short numberOfContours = (short)(bais.read()<<8 | bais.read());
                if (numberOfContours >= 0) {
                    descript[i] = new GlyfSimpleDescript(this, numberOfContours, bais);
                }
            } else {
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.