Package com.intellij.openapi.util.io

Examples of com.intellij.openapi.util.io.ByteSequence


    myPath = path;
    myFile = new File(path);
    mySize = myFile.length();

    if (mySize == 0) {
      appendBytes(new ByteSequence("Header Record For PersistentHashMapValuStorage".getBytes()), 0);
    }
  }
View Full Code Here


        readerHandle.release();
      }
    }

    if (chunkCount > 1 && !myCompactionMode) {
      long l = appendBytes(new ByteSequence(result), 0);
      return new Pair<Long, byte[]>(l, result);
    }

    return new Pair<Long, byte[]>(tailChunkAddress, result);
  }
View Full Code Here

      myEnumerator.markDirty(true);
      myAppendCache.remove(key);

      final AppendStream record = new AppendStream();
      myValueExternalizer.save(record, value);
      final ByteSequence bytes = record.getInternalBuffer();
      final int id = enumerate(key);

      HeaderRecord oldheader = readValueId(id);
      if (oldheader != HeaderRecord.EMPTY) {
        myLiveAndGarbageKeysCounter++;
View Full Code Here

      traverseAllRecords(new PersistentEnumerator.RecordsProcessor() {
        public boolean process(final int keyId) throws IOException {
          final HeaderRecord record = readValueId(keyId);
          if (record.address != NULL_ADDR) {           
            Pair<Long, byte[]> readResult = myValueStorage.readBytes(record.address);
            HeaderRecord value = new HeaderRecord(newStorage.appendBytes(new ByteSequence(readResult.second), 0));
            updateValueId(keyId, value, record, null, getCurrentKey());
            myLiveAndGarbageKeysCounter += LIVE_KEY_MASK;
          }
          return true;
        }
View Full Code Here

      return ((ByteArrayOutputStream)out).toByteArray();
    }
   
    public ByteSequence getInternalBuffer() {
      final BufferExposingByteArrayOutputStream _out = (BufferExposingByteArrayOutputStream)out;
      return new ByteSequence(_out.getInternalBuffer(), 0, _out.size());
    }
View Full Code Here

      myPendingWriteRequests.put(record, future);
    }
  }

  private void doWrite(int record, boolean fixedSize, BufferExposingByteArrayOutputStream s) throws IOException {
    super.writeBytes(record, new ByteSequence(s.getInternalBuffer(), 0, s.size()), fixedSize);
  }
View Full Code Here

      if (newSize > capacity) {
        if (oldSize > 0) {
          final byte[] newbytes = new byte[newSize];
          System.arraycopy(readBytes(record), 0, newbytes, 0, oldSize);
          System.arraycopy(bytes.getBytes(), bytes.getOffset(), newbytes, oldSize, delta);
          writeBytes(record, new ByteSequence(newbytes), false);
        }
        else {
          writeBytes(record, bytes, false);
        }
      }
View Full Code Here

    }

    public void close() throws IOException {
      super.close();
      final BufferExposingByteArrayOutputStream byteStream = getByteStream();
      myStorage.writeBytes(myRecordId, new ByteSequence(byteStream.getInternalBuffer(), 0, byteStream.size()), myFixedSize);
    }
View Full Code Here

    }

    public void close() throws IOException {
      super.close();
      final BufferExposingByteArrayOutputStream _out = (BufferExposingByteArrayOutputStream)out;
      appendBytes(myRecordId, new ByteSequence(_out.getInternalBuffer(), 0, _out.size()));
    }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.util.io.ByteSequence

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.