[
https://issues.apache.org/jira/browse/HADOOP-7817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14578656#comment-14578656
]
Vinayakumar B commented on HADOOP-7817:
---------------------------------------
4. {{assertEquals(pos, out.getPos());}}, better this be asserted against
hardcoded value 4.
5. {code}+ StringBuffer buff = new StringBuffer();
+ FSDataInputStream in = fs.open(path1);
+ int c;
+ while ((c = in.read()) != -1) {
+ buff.append((char) c);
+ }
+
+ //Verify the content
+ assertEquals("text1 text2", buff.toString());{code}
Above one could be also written as
{code} FSDataInputStream in = fs.open(path1);
byte[] buf = new byte[in.available()];
in.read(buf);
// Verify the content
assertEquals("text1 text2", new String(buf));{code}
> RawLocalFileSystem.append() should give FSDataOutputStream with accurate
> .getPos()
> ----------------------------------------------------------------------------------
>
> Key: HADOOP-7817
> URL: https://issues.apache.org/jira/browse/HADOOP-7817
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs
> Affects Versions: 1.0.0
> Reporter: Kristofer Tomasette
> Assignee: kanaka kumar avvaru
> Priority: Minor
> Attachments: HADOOP-7817-01.patch, HADOOP-7817.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> When RawLocalFileSyste.append() is called it returns an FSDataOutputStream
> whose .getPos() returns 0.
> getPos() should return position in the file where appends will start writing.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)