commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r670113 - in /commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary: Base64InputStream.java Base64OutputStream.java
Date Sat, 21 Jun 2008 01:23:50 GMT
Author: sebb
Date: Fri Jun 20 18:23:50 2008
New Revision: 670113

URL: http://svn.apache.org/viewvc?rev=670113&view=rev
Log:
Update the Javadoc

Modified:
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64InputStream.java
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64OutputStream.java

Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64InputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64InputStream.java?rev=670113&r1=670112&r2=670113&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64InputStream.java
(original)
+++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64InputStream.java
Fri Jun 20 18:23:50 2008
@@ -78,12 +78,13 @@
      * @param doEncode      true if we should encode all data read from us,
      *                      false if we should decode.
      * @param lineLength    If doEncode is true, each line of encoded
-     *                      data will contain lineLength characters.  If
-     *                      doEncode is false, lineLength is ignored.
+     *                      data will contain lineLength characters.
+     *                      If lineLength <=0, the encoded data is not divided into lines.
+     *                      If doEncode is false, lineLength is ignored.
      * @param lineSeparator If doEncode is true, each line of encoded
-     *                      data will be terminated with this byte sequence
-     *                      (e.g. \r\n).  If doEncode is false lineSeparator
-     *                      is ignored.
+     *                      data will be terminated with this byte sequence (e.g. \r\n).
+     *                      If lineLength <= 0, the lineSeparator is not used.  
+     *                      If doEncode is false lineSeparator is ignored.
      */
     public Base64InputStream(InputStream in, boolean doEncode, int lineLength, byte[] lineSeparator)
{
         super(in);
@@ -93,6 +94,8 @@
 
     /**
      * Reads one <code>byte</code> from this input stream.
+     * 
+     * @return the byte as an integer in the range 0 to 255
      * Returns -1 if EOF has been reached.
      */
     public int read() throws IOException {
@@ -111,8 +114,15 @@
      * Attempts to read <code>len</code> bytes into the specified
      * <code>b</code> array starting at <code>offset</code> from
      * this InputStream.
-     *
+     * 
+     * @param b destination byte array
+     * @param offset where to start writing the bytes
+     * @param len maximum number of bytes to read
+     * 
+     * @return number of bytes read
      * @throws IOException if an I/O error occurs.
+     * @throws NullPointerException if the byte array parameter is null
+     * @throws IndexOutOfBoundsException if offset, len or buffer size are invalid
      */
     public int read(byte b[], int offset, int len) throws IOException {
         if (b == null) {

Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64OutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64OutputStream.java?rev=670113&r1=670112&r2=670113&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64OutputStream.java
(original)
+++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64OutputStream.java
Fri Jun 20 18:23:50 2008
@@ -77,12 +77,13 @@
      * @param doEncode      true if we should encode all data written to us,
      *                      false if we should decode.
      * @param lineLength    If doEncode is true, each line of encoded
-     *                      data will contain lineLength characters.  If
-     *                      doEncode is false, lineLength is ignored.
+     *                      data will contain lineLength characters.  
+     *                      If lineLength <=0, the encoded data is not divided into lines.
+     *                      If doEncode is false, lineLength is ignored.
      * @param lineSeparator If doEncode is true, each line of encoded
-     *                      data will be terminated with this byte sequence
-     *                      (e.g. \r\n).  If doEncode is false lineSeparator
-     *                      is ignored.
+     *                      data will be terminated with this byte sequence (e.g. \r\n).
 
+     *                      If lineLength <= 0, the lineSeparator is not used.
+     *                      If doEncode is false lineSeparator is ignored.
      */
     public Base64OutputStream(OutputStream out, boolean doEncode, int lineLength, byte[]
lineSeparator) {
         super(out);
@@ -103,7 +104,13 @@
      * <code>b</code> array starting at <code>offset</code> to
      * this output stream.
      *
+     * @param b source byte array
+     * @param offset where to start reading the bytes
+     * @param len maximum number of bytes to write
+     * 
      * @throws IOException if an I/O error occurs.
+     * @throws NullPointerException if the byte array parameter is null
+     * @throws IndexOutOfBoundsException if offset, len or buffer size are invalid
      */
     public void write(byte b[], int offset, int len) throws IOException {
         if (b == null) {
@@ -151,7 +158,9 @@
      *
      * @throws IOException if an I/O error occurs.
      */
-    public void flush() throws IOException { flush(true); }
+    public void flush() throws IOException {
+        flush(true); 
+    }
 
     /**
      * Closes this output stream and releases any system resources



Mime
View raw message