Package java.io

Examples of java.io.BufferedInputStream.skip()


            out = new BufferedOutputStream(
                    new DataOutputStream(getOutputStream()), transferBufferSize*2);
           
            // if resuming, we skip over the unwanted bytes
            if (resume && resumeMarker > 0) {
                in.skip(resumeMarker);
            }
            else
                resumeMarker = 0;
   
            byte[] buf = new byte[transferBufferSize];
View Full Code Here


        int attemptCount = 0;
        String s = "";
        while (attemptCount < MAX_ATTEMPT_COUNT) {
            in.mark(FOUR_KB + (int) nextPos);
            if (nextPos > 0) {
                long skipped = in.skip(nextPos);
                if (skipped != nextPos) {
                    break;
                }
            }
            byte[] buf = new byte[ONE_KB * 3];
 
View Full Code Here

            bytes[i] = (byte) i;
        }
    InputStream in = new BufferedInputStream(
        new ByteArrayInputStream(bytes), 12);
    try {
      in.skip(6);
      in.mark(14);
      in.read(new byte[14], 0, 14);
      in.reset();
      assertTrue("Wrong bytes", in.read() == 6 && in.read() == 7);
    } catch (IOException e) {
View Full Code Here

      fail("Exception during mark test 2");
    }

    in = new BufferedInputStream(new ByteArrayInputStream(bytes), 12);
    try {
      in.skip(6);
      in.mark(8);
      in.skip(7);
      in.reset();
      assertTrue("Wrong bytes 2", in.read() == 6 && in.read() == 7);
    } catch (IOException e) {
View Full Code Here

    in = new BufferedInputStream(new ByteArrayInputStream(bytes), 12);
    try {
      in.skip(6);
      in.mark(8);
      in.skip(7);
      in.reset();
      assertTrue("Wrong bytes 2", in.read() == 6 && in.read() == 7);
    } catch (IOException e) {
      fail("Exception during mark test 3");
    }
View Full Code Here

    }

    //regression for HARMONY-667
        BufferedInputStream buf = new BufferedInputStream(null, 5);
        try {
            buf.skip(10);
            fail("Should throw IOException");
        } catch (IOException e) {
            //expected
        }                        
  }
View Full Code Here

       flipped = !flipped;
    }
   
    // Skip image ID
    if (idLength > 0) {
      bis.skip(idLength);
    }
   
    byte[] rawData = null;
    if ((pixelDepth == 32) || (forceAlpha)) {
      pixelDepth = 32;
View Full Code Here

                    // the two match! Skip over the portion of the current log
                    // that already appears in the historical log file.
                    int duplicateLen = histLog.length - lastLogEntryPos;
                    int skip = duplicateLen - matchLen;
                    if (skip > 0)
                        currentLogIn.skip(skip);
                } else {
                    // the two do not match.  Start a new entry in the historical
                    // log file, and write the first bytes of the current log
                    newBackupOut.write(HIST_SEPARATOR.getBytes());
                    newBackupOut.write(currLogStart, 0, matchLen);
View Full Code Here

    InputStream is = new BufferedInputStream(new FileInputStream("/home/kalle/tmp/perfTest54319.dat"));
    try
    {
      for (int i = 0; i < 50; i++)
      {
        is.skip(IntegerSerializer.DATA_SIZE + LongSerializer.DATA_SIZE);
        keys[i] = readString(is);
        values[i] = readString(is);
      }
    }
    finally
View Full Code Here

       flipped = !flipped;
    }
   
    // Skip image ID
    if (idLength > 0) {
      bis.skip(idLength);
    }
   
    byte[] rawData = null;
    if ((pixelDepth == 32) || (forceAlpha)) {
      pixelDepth = 32;
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.