-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
251 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package org.infinispan.protostream; | ||
|
||
import java.io.Closeable; | ||
import java.io.IOException; | ||
import java.nio.ByteBuffer; | ||
|
||
|
@@ -9,14 +10,14 @@ | |
* @author [email protected] | ||
* @since 4.4 | ||
*/ | ||
public interface TagWriter extends RawProtoStreamWriter { | ||
public interface TagWriter extends RawProtoStreamWriter, Closeable { | ||
|
||
// start low level ops | ||
void flush() throws IOException; | ||
|
||
/** | ||
* Invoke after done with writer, this implies a flush if necessary | ||
* It is necessary to invoke this on a writer returned from {@link #subWriter(int)} to actually push the data | ||
* It is necessary to invoke this on a writer returned from {@link #subWriter(int, boolean)} to actually push the data | ||
*/ | ||
void close() throws IOException; | ||
|
||
|
@@ -99,9 +100,12 @@ default void writeBytes(int number, byte[] value) throws IOException { | |
|
||
/** | ||
* Used to write a sub message that can be optimized by implementation. When the sub writer is complete, flush | ||
* should be invoked to ensure | ||
* @return | ||
* @throws IOException | ||
* should be invoked to ensure bytes are written and close should be invoked to free any resources related to the | ||
* context (note close will flush as well) | ||
* @param number the message number of the sub message | ||
* @param nested whether this is a nested message or a new one | ||
* @return a write context for a sub message | ||
* @throws IOException exception if there is an issue | ||
*/ | ||
TagWriter subWriter(int number, boolean nested) throws IOException; | ||
ProtobufTagMarshaller.WriteContext subWriter(int number, boolean nested) throws IOException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.