Re: Handle Byte Array

"Lars Kühne" <[email protected]>
Newsgroups gmane.comp.java.audit.checkstyle.user
Message-ID <[email protected]>
On 5/23/07, Dominik Karall wrote:
> Does checkstyle provide an interface for reading from a byte array
> instead of handling java File for checking?

No, but this is an open feature request (#737698). Note that you could
wrap your byte[] inside a ByteArrayInputStream and use the suggested
API.

There is only one slight complication, and that is that some checks
(e.g. Translation or PackageHtml) look at neighbor files in the file
system to do their thing, so the "pass in a set of streams" idea is a
bit too simplistic, maybe something like apache commons vfs is
required.

> Because I want to include the checker in a project which should scan
> byte arrays instead of files. If checkstyle doesn't provide such an
> interface, is there any java possibility to use the byte[] as a File
> (without creating one)?

No, that's not possible.

Cheers,
Lars

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.