Package com.firefly.net.buffer

Examples of com.firefly.net.buffer.FileRegion


      try {
        raf = new RandomAccessFile(file, "r");
      } catch (FileNotFoundException fnfe) {
        fnfe.printStackTrace();
      }
      FileRegion fileRegion = null;
      try {
                assert raf != null;
                fileRegion = new FileRegion(raf.getChannel(), 0, raf.length());
      } catch (IOException e) {
        e.printStackTrace();
      }
      session.write(fileRegion);
    } else {
View Full Code Here


      try {
        raf = new RandomAccessFile(file, "r");
      } catch (FileNotFoundException fnfe) {
        fnfe.printStackTrace();
      }
      FileRegion fileRegion = null;
      try {
                assert raf != null;
                fileRegion = new FileRegion(raf.getChannel(), 0, raf.length());
      } catch (IOException e) {
        e.printStackTrace();
      }
      session.write(fileRegion);
    } else {
View Full Code Here

      try {
        raf = new RandomAccessFile(file, "r");
      } catch (FileNotFoundException fnfe) {
        fnfe.printStackTrace();
      }
      FileRegion fileRegion = null;
      try {
                assert raf != null;
                fileRegion = new FileRegion(raf.getChannel(), 0, raf.length());
      } catch (IOException e) {
        e.printStackTrace();
      }
      session.write(fileRegion);
    } else {
View Full Code Here

  }

  public void write(File file, long off, long len) throws IOException {
    flush();
    RandomAccessFile raf = new RandomAccessFile(file, "r");
    FileRegion fileRegion = new FileRegion(raf.getChannel(), off, len);
    session.write(fileRegion);
  }
View Full Code Here

      try {
        raf = new RandomAccessFile(file, "r");
      } catch (FileNotFoundException fnfe) {
        fnfe.printStackTrace();
      }
      FileRegion fileRegion = null;
      try {
                assert raf != null;
                fileRegion = new FileRegion(raf, 0, raf.length());
      } catch (IOException e) {
        e.printStackTrace();
      }
      session.write(fileRegion);
    } else {
View Full Code Here

    count += len;
  }

  public void write(File file, long off, long len) throws IOException {
    flush();
    FileRegion fileRegion = new FileRegion(new RandomAccessFile(file, "r"), off, len);
    session.encode(fileRegion);
  }
View Full Code Here

TOP

Related Classes of com.firefly.net.buffer.FileRegion

Copyright © 2018 www.massapicom. 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.