Package stanfordlogic.util

Examples of stanfordlogic.util.LengthInputStream


        // HttpHeader header = readHeader( reader );

        // Now parse the content, only reading as much as contentLength
        InputStream contentInput;

        contentInput = new LengthInputStream(input, header.contentLength_);

        GdlExpression content = GameManager.getParser().parse(contentInput);

        RequestHandler handler;
View Full Code Here


    public void testRead() throws IOException
    {
        String buffer = "Hello this is a very friendly little buffer";
        ByteArrayInputStream input = new ByteArrayInputStream(buffer.getBytes());
       
        LengthInputStream lis = new LengthInputStream(input, 20);
       
        StringBuilder result = new StringBuilder();
       
        int c;
        while ( (c = lis.read()) != -1 )
        {
            result.append( (char) c);
        }
       
        lis.close();
       
        assertEquals( buffer.substring(0, 20), result.toString() );
    }
View Full Code Here

TOP

Related Classes of stanfordlogic.util.LengthInputStream

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.