[brailleblaster] Re: Input and testing for document package

  • From: Michael Whapples <mwhapples@xxxxxxx>
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Fri, 11 Jan 2013 10:22:33 +0000

In short you cannot find file path fron InputStream, it may be a stream of bytes from something other than a file.


If you wish to go more specific then FileInputStream has a method for finding the file descriptor, but then you are tied to files.

Also it is worth noting the javadocs say that FileInputStream is for reading bytes from a file, if you wish to read characters then use FileReader, see: http://docs.oracle.com/javase/7/docs/api/java/io/FileInputStream.html

Finally, InputStream is not an interface, it is an abstract class. There are differences between the two: Abstract classes may have implementation code where as interfaces are completely abstract, also classes may implement many interfaces but can only extend a single class (abstract or not). It is important to understand the differences and why one might use one over the other. BrailleBlaster probably could do with using a few interfaces.

Michael Whapples
On 11/01/2013 08:35, John J. Boyer wrote:
First, as I suspected, There was a conflict between the name of the
Document class and the nu.xom.Document class. The compiler gave an eror
on the import statement for the latter. I have changed the name of the
Document class to DocumentBase .

To test the document package, wome input is needed. BrailleBlaster can
directly open xml txt and brf files. These are passed through
liblouisutdml to have UTDML added. The augmented document then becomes
the working document. Could someone get DocumentManager working
sufficiently so that a file can be opened and passed to
DocumentBase.startDocument ?

Keith has suggested that the input to startDocument should be
InputStream . However, Inp;utStream is an interface. liblouisutdml
requires a file path. How can the transition be made?

Thanks,
John



Other related posts: