Package java.io

Examples of java.io.FileInputStream.skip()


    r.close();
  }

  public static void processLabeledData(String input,String output) throws Exception{
    FileInputStream is = new FileInputStream(input);
    is.skip(3); //skip BOM
    BufferedReader r = new BufferedReader(
        new InputStreamReader(is, "utf8"));
    OutputStreamWriter w = new OutputStreamWriter(new FileOutputStream(output), "utf8");
    while(true) {
      String sent = r.readLine();
View Full Code Here


        {
            fIn = new FileInputStream(pdfFile);

            final int trailByteCount = (fileLen < readTrailBytes) ? (int) fileLen : readTrailBytes;
            buf = new byte[trailByteCount];
            fIn.skip(skipBytes = fileLen - trailByteCount);

            int off = 0;
            int readBytes;
            while (off < trailByteCount)
            {
View Full Code Here

      int rGroup = 128 * (row / 128);
      int cGroup = 128 * (col / 128);

      int index = 128 * (col - cGroup) + (row - rGroup);
      FileInputStream isBundlx = new FileInputStream(bundlxFileName);
      isBundlx.skip(16 + 5 * index);
      byte[] buffer = new byte[5];
      isBundlx.read(buffer);
      isBundlx.close();
      long offset = (long) (buffer[0] & 0xff) + (long) (buffer[1] & 0xff)
          * 256 + (long) (buffer[2] & 0xff) * 65536
 
View Full Code Here

          * 256 + (long) (buffer[2] & 0xff) * 65536
          + (long) (buffer[3] & 0xff) * 16777216
          + (long) (buffer[4] & 0xff) * 4294967296L;

      FileInputStream isBundle = new FileInputStream(bundleFileName);
      isBundle.skip(offset);
      byte[] lengthBytes = new byte[4];
      isBundle.read(lengthBytes);
      int length = (int) (lengthBytes[0] & 0xff)
          + (int) (lengthBytes[1] & 0xff) * 256
          + (int) (lengthBytes[2] & 0xff) * 65536
 
View Full Code Here

        {
            fIn = new FileInputStream(pdfFile);

            final int trailByteCount = (fileLen < readTrailBytes) ? (int) fileLen : readTrailBytes;
            buf = new byte[trailByteCount];
            fIn.skip(skipBytes = fileLen - trailByteCount);

            int off = 0;
            int readBytes;
            while (off < trailByteCount)
            {
View Full Code Here

      public InputStream open() throws IOException {
         InputStream source = new FileInputStream(file);
         long length = last - first;
        
         if(first > 0) {
            source.skip(first);
         }
         return new Range(source, length);
      }

      /**
 
View Full Code Here

      throw new NotFile();
    FileInputStream fis = null;
    try
    {
      fis = new FileInputStream(file);
      fis.skip(from);
    }
    catch(Exception e)
    {
    }
   
View Full Code Here

   
    byte[] bytes = null;
    FileInputStream fis = null;
    try{
      fis = new FileInputStream(file);
      fis.skip(from);
 
      len = Math.min(fis.available(),len);
      bytes = new byte[len];
      int bytesRead = fis.read(bytes);
      fis.close();
View Full Code Here

    int[] posLen = getStartPosAndLen(code);
    if (posLen != null) {
      try {
        InputStream input = new FileInputStream(new File(db, FILE_DB));
        input.skip(posLen[0]);
        byte[] bytes = new byte[posLen[1]];
        input.read(bytes, 0, posLen[1]);
        input.close();

        String data = new String(bytes);
View Full Code Here

          catch ( NumberFormatException nfe ) {}
        }
      }

      FileInputStream fis = new FileInputStream( f );
      fis.skip( startFrom );
      Response r = new Response( HTTP_OK, mime, fis );
      r.addHeader( "Content-length", "" + (f.length() - startFrom));
      r.addHeader( "Content-range", "" + startFrom + "-" +
            (f.length()-1) + "/" + f.length());
      return r;
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.