Package lupos.datastructures.buffermanager

Examples of lupos.datastructures.buffermanager.ContinousPagesInputStream


  @SuppressWarnings("unused")
  private long getAddressOfNextElement(final long address){
    final int pagenumber = (int) (address / PageManager.getDefaultPageSize());
    final int index = (int) (address % PageManager.getDefaultPageSize());
    try {
      final InputStream in = new ContinousPagesInputStream(pagenumber, new PageManager(this.valuesFilename, false, false), index);
      final long numberOfElements = InputHelper.readLuposLong(in);
      final long addressOfNextElement = InputHelper.readLuposLong(in);
      in.close();
      return addressOfNextElement;
    } catch (final IOException e) {
      System.err.println(e);
      e.printStackTrace();
    }
View Full Code Here


      this.closeOutputStream();
      return new Iterator<E>(){

        int index = 0;

        final ContinousPagesInputStream in = new ContinousPagesInputStream(0, PagedCollection.this.pageManager, 12);
        int currentPageNumber;
        int currentIndexInPage;

        @Override
        public boolean hasNext() {
View Full Code Here

  private final boolean decrementNumberOfElements(final long address){
    final int pagenumber = (int) (address / PageManager.getDefaultPageSize());
    final int index = (int) (address % PageManager.getDefaultPageSize());
    try {
      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();
View Full Code Here

  private final long setNumberOfElementsTo0(final long address){
    final int pagenumber = (int) (address / PageManager.getDefaultPageSize());
    final int index = (int) (address % PageManager.getDefaultPageSize());
    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;
View Full Code Here

  private final Triple<V, Long, Long> getElement(final long address) {
    final int pagenumber = (int) (address / PageManager.getDefaultPageSize());
    final int index = (int) (address % PageManager.getDefaultPageSize());
    try {
      final InputStream in = new ContinousPagesInputStream(pagenumber, new PageManager(this.valuesFilename, false, false), index);
      final long numberOfElements = InputHelper.readLuposLong(in);
      final long addressOfNextElement = InputHelper.readLuposLong(in);
      final V element = Registration.deserializeWithoutId(this.classOfValues, in);
      in.close();
      return new Triple<V, Long, Long>(element, numberOfElements, addressOfNextElement);
    } catch (final IOException e) {
      System.err.println(e);
      e.printStackTrace();
    } catch (final ClassNotFoundException e) {
View Full Code Here

TOP

Related Classes of lupos.datastructures.buffermanager.ContinousPagesInputStream

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.