Package java.io

Examples of java.io.InputStream.skip()


    try
    {
      is = new FileInputStream(file);
      is = new BufferedInputStream(is);

      is.skip(length - ID3_V1_TAG_LENGTH);

      bytes = FileUtils.readArray(is, ID3_V1_TAG_LENGTH);
    } finally
    {
      try
View Full Code Here


    InputStream is = null;
    try {
      String classFileName = "/" + Lang.class.getName().replace('.', '/') + ".class";
      is = Lang.class.getClassLoader().getResourceAsStream(classFileName);
      if (is != null && is.available() > 8) {
        is.skip(7);
        return is.read() > 49;
      }
    }
    catch (Throwable e) {}
    finally {
View Full Code Here

    try
    {
      is = new FileInputStream(file);
      is = new BufferedInputStream(is);

      is.skip(length - index);

      byte footer[];
      footer = FileUtils.readArray(is, ID3v2_HEADER_LENGTH);

      if (footer[0] != 0x33) // 3
View Full Code Here

    try
    {
      is = new FileInputStream(file);
      is = new BufferedInputStream(is);

      is.skip(length - index);

      byte footer[];
      footer = FileUtils.readArray(is, ID3v2_HEADER_LENGTH);

      if (footer[2] != 0x33) // 3
View Full Code Here

      skip -= ID3v2_HEADER_LENGTH;
      skip -= bodyLength;
      skip -= ID3v2_HEADER_LENGTH;
      if (hasId3v1)
        skip -= ID3_V1_TAG_LENGTH;
      is.skip(skip);

      byte header_and_body[] = FileUtils.readArray(is,
          ID3v2_HEADER_LENGTH + bodyLength + ID3v2_HEADER_LENGTH);

      byte result[] = header_and_body;
View Full Code Here

      ByteArrayOutputStream bos = new ByteArrayOutputStream();

      InputStream is = getBinaryStream();

      if (pos > 1)
        is.skip(pos - 1);

      for (int i = 0; i < length; i++) {
        int ch = is.read();

        if (ch < 0)
View Full Code Here

                    // Get expected value
                    InputStream inStream = blob.getBinaryStream();
                    long left = blobLength - 100;
                    long read = 0;
                    while (left > 0 && read != -1) {
                        read = inStream.skip(Math.min(1024, left));
                        left -= read > 0? read : 0;
                    }
                    byte[] expected = new byte[100];
                    read = inStream.read(expected);
                    inStream.close();
View Full Code Here

            // Get expected value usign Blob.getBinaryStream()
            byte[] value = new byte[length];
            String valueString;
            InputStream inStream = blob.getBinaryStream();
            inStream.skip(pos - 1);
            int numBytes = inStream.read(value);
            // check that the two values match
            if (numBytes >= 0) {
                byte[] readBytes = new byte[numBytes];
                System.arraycopy(value, 0, readBytes, 0, numBytes);
View Full Code Here

                        int b0 = b4[0] & 0xFF;
                        int b1 = b4[1] & 0xFF;
                        int b2 = b4[2] & 0xFF;
                        if (b0 == 0xEF && b1 == 0xBB && b2 == 0xBF) {
                            // ignore first three bytes...
                            stream.skip(3);
                        }
                    }
                    reader = createReader(stream, encoding, isBigEndian);
                }
                else {
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

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.