Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / api / files / RecordWriteChannel.java
blob67317bea3272ed1099999c501d1d0816a077f4f9
1 // Copyright 2011 Google Inc. All Rights Reserved.
3 package com.google.appengine.api.files;
5 import java.io.IOException;
6 import java.nio.ByteBuffer;
7 import java.nio.channels.WritableByteChannel;
9 /**
10 * A {@link WritableByteChannel} for writing records to a {@link FileWriteChannel}.
11 * <p>
12 * The format of these records is defined by the leveldb log format:
13 * http://leveldb.googlecode.com/svn/trunk/doc/log_format.txt
14 * </p>
15 * <p>
16 * An instance of {@link RecordWriteChannel} may be obtained from the method:
17 * {@link FileService#openRecordWriteChannel(AppEngineFile, boolean)}.
18 * </p>
19 * Just like {@link WritableByteChannel} If one thread initiates a write operation upon a channel
20 * then any other thread that attempts to initiate another write operation will block until the
21 * first operation is complete.
25 @Deprecated
26 public interface RecordWriteChannel extends WritableByteChannel {
28 /**
29 * Writes the data out to FileWriteChannel.
30 * @see com.google.appengine.api.files.FileWriteChannel#write(ByteBuffer, String)
32 public int write(ByteBuffer src, String sequenceKey) throws IOException;
34 /**
35 * Closes the file.
36 * @see com.google.appengine.api.files.FileWriteChannel#closeFinally()
38 public void closeFinally() throws IllegalStateException, IOException;