title: How do I read the content of a file in Amazon S3
body: <p>I have a file in <code>Amazon S3</code> in bucket <code>ABCD</code>. I have 3 objects <code>("folderA/folderB/folderC/abcd.csv")</code> which are folders and in the final folder I have a <code>.csv</code> file <code>(abcd.csv)</code>. I have used a logic to convert it to <code>JSON</code> and load it back into another file which is a <code>.txt</code> file in the same folder <code>("folderA/folderB/folderC/abcd.txt")</code>. I had to download the file locally in order to do that. How would I read the file directly and write it back to the text file. The code which I have used to write to a file in S3 is below and I need to read a file from S3.</p>
  
  <pre><code> InputStream inputStream = new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_16));
   ObjectMetadata metadata = new ObjectMetadata();
   metadata.setContentLength(json.length());
   PutObjectRequest request = new PutObjectRequest(bucketPut, filePut, inputStream, metadata);
   s3.putObject(request);
  </code></pre>