Package org.apache.jena.atlas.io

Examples of org.apache.jena.atlas.io.InStreamUTF8


           
            long charCount = 0 ;
            long lineNum = INIT_LINE ;
            long colNum = INIT_COL ;
           
            InStreamUTF8 utf8 = null ;
            try {
                utf8 = new InStreamUTF8(in) ;
                for (;;)
                {
                    int ch = utf8.read() ;
                    if ( ch == -1 )
                        break ;
                    charCount++ ;
                    if (ch == '\n')
                    {
View Full Code Here


            try {
                byte[] bytes = stringAsBytes(x) ;

                ByteArrayInputStream bin = new ByteArrayInputStream(bytes) ;
                // Create string from bytes
                InStreamUTF8 r = new InStreamUTF8(bin) ;
                //Get tests working.
                //Reader r = new InputStreamReader(bin, utf8) ;

                char[] cbuff = new char[x.length()*10] ;    // Way too big
                int len = r.read(cbuff) ;
                String str = new String(cbuff, 0 , len) ;
                assertEquals(x, str) ;
                r.close();
            } catch (IOException ex) { throw new RuntimeException(ex) ; }
        }
View Full Code Here

TOP

Related Classes of org.apache.jena.atlas.io.InStreamUTF8

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.