Skip to content

Commit 8494bec

Browse files
committed
Update the Javadoc
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@670113 13f79535-47bb-0310-9956-ffa450edef68
1 parent a8502b5 commit 8494bec

2 files changed

Lines changed: 31 additions & 12 deletions

File tree

src/java/org/apache/commons/codec/binary/Base64InputStream.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,13 @@ public Base64InputStream(InputStream in, boolean doEncode) {
7878
* @param doEncode true if we should encode all data read from us,
7979
* false if we should decode.
8080
* @param lineLength If doEncode is true, each line of encoded
81-
* data will contain lineLength characters. If
82-
* doEncode is false, lineLength is ignored.
81+
* data will contain lineLength characters.
82+
* If lineLength <=0, the encoded data is not divided into lines.
83+
* If doEncode is false, lineLength is ignored.
8384
* @param lineSeparator If doEncode is true, each line of encoded
84-
* data will be terminated with this byte sequence
85-
* (e.g. \r\n). If doEncode is false lineSeparator
86-
* is ignored.
85+
* data will be terminated with this byte sequence (e.g. \r\n).
86+
* If lineLength <= 0, the lineSeparator is not used.
87+
* If doEncode is false lineSeparator is ignored.
8788
*/
8889
public Base64InputStream(InputStream in, boolean doEncode, int lineLength, byte[] lineSeparator) {
8990
super(in);
@@ -93,6 +94,8 @@ public Base64InputStream(InputStream in, boolean doEncode, int lineLength, byte[
9394

9495
/**
9596
* Reads one <code>byte</code> from this input stream.
97+
*
98+
* @return the byte as an integer in the range 0 to 255
9699
* Returns -1 if EOF has been reached.
97100
*/
98101
public int read() throws IOException {
@@ -111,8 +114,15 @@ public int read() throws IOException {
111114
* Attempts to read <code>len</code> bytes into the specified
112115
* <code>b</code> array starting at <code>offset</code> from
113116
* this InputStream.
114-
*
117+
*
118+
* @param b destination byte array
119+
* @param offset where to start writing the bytes
120+
* @param len maximum number of bytes to read
121+
*
122+
* @return number of bytes read
115123
* @throws IOException if an I/O error occurs.
124+
* @throws NullPointerException if the byte array parameter is null
125+
* @throws IndexOutOfBoundsException if offset, len or buffer size are invalid
116126
*/
117127
public int read(byte b[], int offset, int len) throws IOException {
118128
if (b == null) {

src/java/org/apache/commons/codec/binary/Base64OutputStream.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ public Base64OutputStream(OutputStream out, boolean doEncode) {
7777
* @param doEncode true if we should encode all data written to us,
7878
* false if we should decode.
7979
* @param lineLength If doEncode is true, each line of encoded
80-
* data will contain lineLength characters. If
81-
* doEncode is false, lineLength is ignored.
80+
* data will contain lineLength characters.
81+
* If lineLength <=0, the encoded data is not divided into lines.
82+
* If doEncode is false, lineLength is ignored.
8283
* @param lineSeparator If doEncode is true, each line of encoded
83-
* data will be terminated with this byte sequence
84-
* (e.g. \r\n). If doEncode is false lineSeparator
85-
* is ignored.
84+
* data will be terminated with this byte sequence (e.g. \r\n).
85+
* If lineLength <= 0, the lineSeparator is not used.
86+
* If doEncode is false lineSeparator is ignored.
8687
*/
8788
public Base64OutputStream(OutputStream out, boolean doEncode, int lineLength, byte[] lineSeparator) {
8889
super(out);
@@ -103,7 +104,13 @@ public void write(int i) throws IOException {
103104
* <code>b</code> array starting at <code>offset</code> to
104105
* this output stream.
105106
*
107+
* @param b source byte array
108+
* @param offset where to start reading the bytes
109+
* @param len maximum number of bytes to write
110+
*
106111
* @throws IOException if an I/O error occurs.
112+
* @throws NullPointerException if the byte array parameter is null
113+
* @throws IndexOutOfBoundsException if offset, len or buffer size are invalid
107114
*/
108115
public void write(byte b[], int offset, int len) throws IOException {
109116
if (b == null) {
@@ -151,7 +158,9 @@ private void flush(boolean propogate) throws IOException {
151158
*
152159
* @throws IOException if an I/O error occurs.
153160
*/
154-
public void flush() throws IOException { flush(true); }
161+
public void flush() throws IOException {
162+
flush(true);
163+
}
155164

156165
/**
157166
* Closes this output stream and releases any system resources

0 commit comments

Comments
 (0)