private void newKeyForObject(Key key) throws IOException {
   requireValidNewToken(key);
   startIfNeeded();
   if (!(key instanceof NoKey)) {
     sendPersistenceChain();
   }
   entries.add(key);
 }
  @Override
  public void putByteSequence(ByteSequence byteSequence, Key key) throws IOException {
    requireValidNewToken(key);
    startIfNeeded();
    sendPersistenceChain();
    entries.add(key);

    marshalTarget.putByteSequence(byteSequence, key);
  }
  @Override
  public OutputStream newOutputStream(Key key) throws IOException {
    requireValidNewToken(key);
    startIfNeeded();
    sendPersistenceChain();
    entries.add(key);

    MonitoredOutputStream outputStream =
        new MonitoredOutputStream(marshalTarget.newOutputStream(key));
    openOutputStreams.put(outputStream, key);
    return outputStream;
  }