| OLD | NEW |
| 1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
| 2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
| 3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
| 4 // | 4 // |
| 5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
| 6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
| 7 // met: | 7 // met: |
| 8 // | 8 // |
| 9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
| 10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 package com.google.protobuf; | 31 package com.google.protobuf; |
| 32 | 32 |
| 33 import java.io.IOException; | 33 import java.io.IOException; |
| 34 import java.nio.ByteBuffer; | 34 import java.nio.ByteBuffer; |
| 35 | 35 |
| 36 /** | 36 /** |
| 37 * An output target for raw bytes. This interface provides semantics that suppor
t two types of | 37 * An output target for raw bytes. This interface provides semantics that suppor
t two types of |
| 38 * writing: | 38 * writing: |
| 39 * | 39 * |
| 40 * <p><b>Traditional write operations:</b> | 40 * <p/><b>Traditional write operations:</b> |
| 41 * (as defined by {@link java.io.OutputStream}) where the target method is respo
nsible for either | 41 * (as defined by {@link java.io.OutputStream}) where the target method is respo
nsible for either |
| 42 * copying the data or completing the write before returning from the method cal
l. | 42 * copying the data or completing the write before returning from the method cal
l. |
| 43 * | 43 * |
| 44 * <p><b>Lazy write operations:</b> where the caller guarantees that it will nev
er modify the | 44 * <p/><b>Lazy write operations:</b> where the caller guarantees that it will ne
ver modify the |
| 45 * provided buffer and it can therefore be considered immutable. The target meth
od is free to | 45 * provided buffer and it can therefore be considered immutable. The target meth
od is free to |
| 46 * maintain a reference to the buffer beyond the scope of the method call (e.g.
until the write | 46 * maintain a reference to the buffer beyond the scope of the method call (e.g.
until the write |
| 47 * operation completes). | 47 * operation completes). |
| 48 */ | 48 */ |
| 49 @ExperimentalApi | 49 @ExperimentalApi |
| 50 public abstract class ByteOutput { | 50 public abstract class ByteOutput { |
| 51 /** | 51 /** |
| 52 * Writes a single byte. | 52 * Writes a single byte. |
| 53 * | 53 * |
| 54 * @param value the byte to be written | 54 * @param value the byte to be written |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 * | 107 * |
| 108 * <p>NOTE: This method <strong>MUST NOT</strong> modify the {@code value}. Do
ing so is a | 108 * <p>NOTE: This method <strong>MUST NOT</strong> modify the {@code value}. Do
ing so is a |
| 109 * programming error and will lead to data corruption which will be difficult
to debug. | 109 * programming error and will lead to data corruption which will be difficult
to debug. |
| 110 * | 110 * |
| 111 * @param value the bytes to be written. Upon returning from this call, the {@
code position} of | 111 * @param value the bytes to be written. Upon returning from this call, the {@
code position} of |
| 112 * this buffer will be set to the {@code limit} | 112 * this buffer will be set to the {@code limit} |
| 113 * @throws IOException thrown if an error occurred while writing | 113 * @throws IOException thrown if an error occurred while writing |
| 114 */ | 114 */ |
| 115 public abstract void writeLazy(ByteBuffer value) throws IOException; | 115 public abstract void writeLazy(ByteBuffer value) throws IOException; |
| 116 } | 116 } |
| OLD | NEW |