[brailleblaster] Re: byte arrays versus strings

  • From: "John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxxx>
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Fri, 10 Dec 2010 01:29:09 -0600

Laura,

As I see it, your code should be written for generality, so it can be 
used to calll other command-line filters. The input and output streams 
should therefore be strings. 

Another part of your code might take a stream containing a MathML 
fragment and convert it to a JDOM subtree. This code might be useful in 
other parts of BrailleBlaster, so it should  also be generalized.

Hope this helps,
John B.

On Thu, Dec 09, 2010 at 07:25:06PM -0600, qubit wrote:
> Ok, this is where I need JohnB's expertise with characters and byte strings. 
> Of course, anyone else can chime in too.
> 
> I have a buffered stream going from brailleblaster to the input of process 
> just spawned, and 2 streams coming back for standard error and standard out.
> 
> I will be managing the pipes in a class constructor / finalizer.
> My question is, in the docs for the input and output streams in java.io, 
> there are subclasses that manage byte arrays and subclasses that do just 
> character strings.
> My class will provide you with a read and a write method.  Should I just 
> assume that everything that goes over the pipe is a character stream, or are 
> there cases where I can't assume that?
> 
> Should this be a character stream or a byte stream?
> Should I use threads that handle the input and output on these streams?
> 
> I am trying to get all my "ducks in a row" as a family member likes to say.
> Any comments are welcome.
> --le 
> 

-- 
John J. Boyer; President, Chief Software Developer
Abilitiessoft, Inc.
http://www.abilitiessoft.com
Madison, Wisconsin USA
Developing software for people with disabilities


Other related posts: