Probably. But it works, so I will not bother to change it
On Feb 18, 2014 6:37 AM, "Mihai Codoban" <notifications@github.com> wrote:

> In
> edu.oregonstate.cope.eclipse/src/edu/oregonstate/cope/eclipse/listeners/ResourceListener.java:
>
> > +		readFromTo(inputStream, byteArrayOutputStream);
> > +		byte[] bytes = byteArrayOutputStream.toByteArray();
> > +		byteArrayOutputStream.close();
> > +		return new String(bytes);
> > +	}
> > +
> > +	/**
> > +	 * I return a base64 encoding of the file contents.
> > +	 * @param inputStream the InputStream I have to read from.
> > +	 * @return the base64 string containing the encoded file contents.
> > +	 * @throws IOException if I cannot read from the InputStream.
> > +	 */
> > +	private String getBinaryFileContents(InputStream inputStream) throws IOException {
> > +		ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
> > +		Base64OutputStream base64OutputStream = new Base64OutputStream(byteArrayOutputStream, true, 0, null);
> > +		readFromTo(inputStream, base64OutputStream);
>
> Or even better: byte[] bytes = Files.readAllBytes(Paths.get(filename));
> Mihai
> ... <#144456e7c254b200_>
> On Tue, Feb 18, 2014 at 9:36 AM, Mihai Codoban <codobanmihai@gmail.com>wrote:
> > I wonder if this does the same thing but in one line of code: >
> http://stackoverflow.com/a/7250275/417199 > > > > Mihai > > > On Mon, Feb
> 17, 2014 at 10:21 PM, Caius Brindescu < > notifications@github.com>
> wrote: > In >
> edu.oregonstate.cope.eclipse/src/edu/oregonstate/cope/eclipse/listeners/ResourceListener.java:
> > > > + readFromTo(inputStream, byteArrayOutputStream); > > + byte[] bytes
> = byteArrayOutputStream.toByteArray(); > > + byteArrayOutputStream.close();
> > > + return new String(bytes); > > + } > > + > > + /** > > + * I return a
> base64 encoding of the file contents. > > + * @param<https://github.com/param>inputStream the InputStream I have to read from. > > + *
> @return <https://github.com/return> the base64 string containing the
> encoded file contents. > > + * @throws <https://github.com/throws>IOException if I cannot read from the InputStream. > > + */ > > + private
> String getBinaryFileContents(InputStream inputStream) throws IOException {
> > > + ByteArrayOutputStream byteArrayOutputStream = new
> ByteArrayOutputStream(); > > + Base64OutputStream base64OutputStream = new
> Base64OutputStream(byteArrayOutputStream, true, 0, null); > > +
> readFromTo(inputStream, base64OutputStream); > > Well, this method does
> just that. It reads the "random" bytes from the > input streams and returns
> ASCII-readable bytes on the other end. > > -- > Reply to this email
> directly or view it on GitHub<
> https://github.com/ChangeOrientedProgrammingEnvironment/clientRecorder/pull/116/files#r9811493>
> > . >
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/ChangeOrientedProgrammingEnvironment/clientRecorder/pull/116/files#r9825052>
> .
>