Skip to content
Advertisement

Tag: stream

Understanding getInputStream and getOutputStream

Here is a code I have marked the statements that I have problems understanding. I do not understand what OutputStream object out will hold when it is assigned s.getOutputStream() and what is the need of passing buf to out by out.write(buf). I have learned Input and Output Streams using files but I do not understand getinputstream and outputstreams. I have

platform-independent /dev/null output sink for Java

Other than an anonymous class (new OutputStream() { … }), can anyone suggest a moral equivalent of new FileOutputStream(“/dev/null”) that also works on Windows? In case someone’s wondering ‘what’s this for?’ I have a program that does a consistency analysis on a file. It has a ‘verbose’ option. When the verbose option is on, I want to see a lot

Listen to a shoutcast with Android

since quite some time I’m trying to listen to .pls files (shoutcasts). I have to say that I failed horrible. Since StreamFurious can do it it must be possible. First I tried to connect to the shoutcast via sockets (TCP and UDP) –> failed. I couldn’t even receive one byte from the server. I’m at the verge of tears. I

Play WAV file backward

I’m making Braid in Java. If you rewind the time, the sound plays backward. How to play a WAV file backwards? Maybe with a stream with something like previous()? On the site of Braid can you see what I mean. Update: Solved! See my own post. Answer I solved it by myself And then:

Most efficient way to create InputStream from OutputStream

This page: http://blog.ostermiller.org/convert-java-outputstream-inputstream describes how to create an InputStream from OutputStream: Other alternatives are to use PipedStreams and new threads which is cumbersome. I do not like the idea of copying many megabytes to new in memory byte array. Is there a library that does this more efficiently? EDIT: By advice from Laurence Gonsalves, i tried PipedStreams and it turned

Java Large Files Disk IO Performance

I have two (2GB each) files on my harddisk and want to compare them with each other: Copying the original files with Windows explorer takes approx. 2-4 minutes (that is reading and writing – on the same physical and logical disk). Reading with java.io.FileInputStream twice and comparing the byte arrays on a byte per byte basis takes 20+ minutes. java.io.BufferedInputStream

Advertisement