Exemplo n.º 1
0
 public void writeTo(OutputStream out) throws IOException {
   if (mSpillover == null) {
     mLocalBuffer.writeTo(out);
   } else {
     mSpillover.writeTo(out);
   }
 }
Exemplo n.º 2
0
  private void spillover() throws IOException {
    mSpillover = mGroup.createFileByteBuffer();
    // TODO: This is bad! By writing out the contents of the existing
    // buffer early, surrogates are evaluated too soon!
    mLocalBuffer.writeTo(new ByteBufferOutputStream(mSpillover));

    long count = mLocalBuffer.getBaseByteCount();
    mLocalBuffer = null;
    mGroup.adjustLevel(-count);
  }