Package lupos.datastructures.buffermanager

Examples of lupos.datastructures.buffermanager.ContinousPagesOutputStream


      final InputStream in = new ContinousPagesInputStream(pagenumber, new PageManager(this.valuesFilename, false, false), index);
      long numberOfElements = InputHelper.readLuposLong(in);
      in.close();
      if(numberOfElements>0){
        numberOfElements--;
        final OutputStream out = new ContinousPagesOutputStream(pagenumber, new PageManager(this.valuesFilename, false, false), index);
        OutHelper.writeLuposLong(numberOfElements, out);
        out.close();
        return true;
      }
    } catch (final IOException e) {
      System.err.println(e);
      e.printStackTrace();
View Full Code Here


    try {
      final InputStream in = new ContinousPagesInputStream(pagenumber, new PageManager(this.valuesFilename, false, false), index);
      final long numberOfElements = InputHelper.readLuposLong(in);
      in.close();
      if(numberOfElements>0){
        final OutputStream out = new ContinousPagesOutputStream(pagenumber, new PageManager(this.valuesFilename, false, false), index);
        OutHelper.writeLuposLong(0, out);
        out.close();
        return numberOfElements;
      }
    } catch (final IOException e) {
      System.err.println(e);
      e.printStackTrace();
View Full Code Here

  private final void storeElement(final V element, final long numberOfElements, final long nextEntry, final long address) {
    final int pagenumber = (int) (address / PageManager.getDefaultPageSize());
    final int index = (int) (address % PageManager.getDefaultPageSize());
    try {
      final OutputStream out = new ContinousPagesOutputStream(pagenumber, new PageManager(this.valuesFilename, false, false), index);
      OutHelper.writeLuposLong(numberOfElements, out); // currently one element inside!
      OutHelper.writeLuposLong(nextEntry, out); // end of list!
      Registration.serializeWithoutId(element, out);
      out.close();
    } catch (final IOException e) {
      System.err.println(e);
      e.printStackTrace();
    }
  }
View Full Code Here

TOP

Related Classes of lupos.datastructures.buffermanager.ContinousPagesOutputStream

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.