Package org.apache.commons.io.input

Examples of org.apache.commons.io.input.CharSequenceReader


    @Test
    public void givenUsingCommonsIO_whenConvertingInputStreamIntoReader_thenCorrect() throws IOException {
        final InputStream initialStream = IOUtils.toInputStream("With Commons IO");
        final byte[] buffer = IOUtils.toByteArray(initialStream);
        final Reader targetReader = new CharSequenceReader(new String(buffer));

        targetReader.close();
    }
View Full Code Here


        } catch (PrivilegedActionException pae){
            Exception e = pae.getException();
            log.error("Unable to initialise PoadingAnalyzer",e);
            throw new EngineException("Unable to initialise PoadingAnalyzer",e);
        }
        TokenStream ts = pa.tokenStream("dummy", new CharSequenceReader(at.getText()));
        int lastEnd = 0;
        try {
            while(ts.incrementToken()){
                OffsetAttribute offset = ts.addAttribute(OffsetAttribute.class);
                //when tokenizing labels we need to preserve all chars
View Full Code Here

TOP

Related Classes of org.apache.commons.io.input.CharSequenceReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.