hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r675779 - in /hadoop/core/branches/branch-0.18: CHANGES.txt src/core/org/apache/hadoop/fs/kfs/KFSOutputStream.java
Date Thu, 10 Jul 2008 21:59:19 GMT
Author: cdouglas
Date: Thu Jul 10 14:59:18 2008
New Revision: 675779

URL: http://svn.apache.org/viewvc?rev=675779&view=rev
Log:
HADOOP-3718. Fix KFSOutputStream::write(int) to output a byte instead of
an int, per the OutputStream contract. Contributed by Sriram Rao.

Modified:
    hadoop/core/branches/branch-0.18/CHANGES.txt
    hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/fs/kfs/KFSOutputStream.java

Modified: hadoop/core/branches/branch-0.18/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/CHANGES.txt?rev=675779&r1=675778&r2=675779&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/CHANGES.txt Thu Jul 10 14:59:18 2008
@@ -741,6 +741,9 @@
     prevents it from loading user-specified InputFormats.
     (Jingkei Ly via cdouglas)
 
+    HADOOP-3718. Fix KFSOutputStream::write(int) to output a byte instead of
+    an int, per the OutputStream contract. (Sriram Rao via cdouglas)
+
 Release 0.17.2 - Unreleased
 
   BUG FIXES

Modified: hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/fs/kfs/KFSOutputStream.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/fs/kfs/KFSOutputStream.java?rev=675779&r1=675778&r2=675779&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/fs/kfs/KFSOutputStream.java
(original)
+++ hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/fs/kfs/KFSOutputStream.java
Thu Jul 10 14:59:18 2008
@@ -55,13 +55,10 @@
         if (kfsChannel == null) {
             throw new IOException("File closed");
         }
-        byte[] b = new byte[4];
+        byte[] b = new byte[1];
 
-        b[0] = (byte) (v & 0xFF);
-        b[1] = (byte) ((v >> 8) & 0xFF);
-        b[1] = (byte) ((v >> 16) & 0xFF);
-        b[1] = (byte) ((v >> 24) & 0xFF);
-        write(b, 0, 4);
+        b[0] = (byte) v;
+        write(b, 0, 1);
     }
 
     public void write(byte b[], int off, int len) throws IOException {



Mime
View raw message