diff options
author | corysmith <corysmith@google.com> | 2018-02-16 15:48:49 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-02-16 15:50:13 -0800 |
commit | d18d3e2f83f9d582858a3edab7a450c60044028c (patch) | |
tree | 16ff3c0dff1e87a60ddcafaea2917623d48ef096 /src/tools/android/java/com/google/devtools/build/android/DataKey.java | |
parent | d7a56179ab35bf21ee6d77d87bb0096bef042175 (diff) |
Automated rollback of commit f672a31b8b19baab95373e4f2f6d110aa8b8f0fb.
*** Reason for rollback ***
Unclassified general breakages in tests. Rolling back for further investigation.
*** Original change description ***
Normalized the serialization proto to save space and allow greater versatility in storage.
RELNOTES: None
PiperOrigin-RevId: 186057879
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/DataKey.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/DataKey.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/DataKey.java b/src/tools/android/java/com/google/devtools/build/android/DataKey.java index f8a76a5768..02f193c0f7 100644 --- a/src/tools/android/java/com/google/devtools/build/android/DataKey.java +++ b/src/tools/android/java/com/google/devtools/build/android/DataKey.java @@ -13,6 +13,9 @@ // limitations under the License. package com.google.devtools.build.android; +import java.io.IOException; +import java.io.OutputStream; + /** * A general interface for resource and asset keys. * @@ -23,7 +26,16 @@ package com.google.devtools.build.android; * * <p>For Assets, it is the asset path from the assets directory. */ -public interface DataKey extends Comparable<DataKey>, Writeable { +public interface DataKey extends Comparable<DataKey> { + + /** + * Writes the Key and the value size to a stream. + * + * @param output The destination stream to serialize the key. + * @param valueSize The size, in bytes, of the serialized output for this key. The value size can + * be used for calculating offsets of the value in the stream. + */ + void serializeTo(OutputStream output, int valueSize) throws IOException; /** Returns a human readable string representation of the key. */ String toPrettyString(); |