Package lupos.io

Examples of lupos.io.ExistingByteArrayOutputStream


        final long addressOfKey = this.storeNewKey(key);

        if(pointer == 0){
          // no entry so far at this position in the hash table...
          // write address in hash table
          final OutputStream outKeys = new ExistingByteArrayOutputStream(pagePointers, hashAddress * 8);
          OutHelper.writeLuposLong(addressOfKey, outKeys);
          outKeys.close();
          BufferManager.getBufferManager().modifyPage(this.TABLEPAGESIZE, pageAddressPointers, pagePointers);
        } else {
          // already entries at this position in the hash table...
          this.storeAddressOfNextKey(addressOfKey, addressOfLastKey);
        }
View Full Code Here


            final PageAddress pageAddress = new PageAddress(0, this.pointersFilename);
            final byte[] page = BufferManager.getBufferManager().getPage(this.TABLEPAGESIZE, pageAddress);

            final int hashAddress = Math.abs(thiskey.hashCode()) % this.TABLESIZE;

            final OutputStream outKeys = new ExistingByteArrayOutputStream(page, hashAddress * 8);
            OutHelper.writeLuposLong(0, outKeys);
            outKeys.close();
            BufferManager.getBufferManager().modifyPage(this.TABLEPAGESIZE, pageAddress, page);
          } catch (final IOException e) {
            System.err.println(e);
            e.printStackTrace();
          }
        } // key is not last entry in key list
        else {
          try {
            final PageAddress pageAddressPointers = new PageAddress(0, this.pointersFilename);
            final byte[] pagePointers = BufferManager.getBufferManager().getPage(this.TABLEPAGESIZE, pageAddressPointers);

            final int hashAddress = Math.abs(thiskey.hashCode()) % this.TABLESIZE;

            final OutputStream outKeys = new ExistingByteArrayOutputStream(pagePointers, hashAddress * 8);
            OutHelper.writeLuposLong(this.getKey(addressOfFoundKey).getFourth(), outKeys);
            outKeys.close();
            BufferManager.getBufferManager().modifyPage(this.TABLEPAGESIZE, pageAddressPointers, pagePointers);
          } catch (final IOException e) {
            System.err.println(e);
            e.printStackTrace();
          }
View Full Code Here

      if(pointer == 0) {
        // no entry so far at this position in the hash table...
        final long address = this.storeNewElement(element);
        // write address in hash table
        final OutputStream out = new ExistingByteArrayOutputStream(page, hashAddress * 8);
        OutHelper.writeLuposLong(address, out);
        out.close();
        BufferManager.getBufferManager().modifyPage(this.TABLEPAGESIZE, pageAddress, page);
        return true;
      } else {
        // check existing list of entries for this table position
        Triple<V, Long, Long> entry;
View Full Code Here

    }
  }

  protected final void storeSizeAndEndOfCollection() throws IOException {
    final byte[] page = this.pageManager.getPage(0);
    final ExistingByteArrayOutputStream out1 = new ExistingByteArrayOutputStream(page, 0);
    OutHelper.writeLuposInt(this.size, out1);
    OutHelper.writeLuposLong(this.endOfCollection, out1);
    out1.close();
    this.pageManager.modifyPage(0, page);
  }
View Full Code Here

TOP

Related Classes of lupos.io.ExistingByteArrayOutputStream

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.