com.google.caliper.util
Class InterleavedReader

java.lang.Object
  extended by com.google.caliper.util.InterleavedReader
All Implemented Interfaces:
Closeable

public final class InterleavedReader
extends Object
implements Closeable

Reads a stream containing inline JSON objects. Each JSON object is prefixed by a marker string and suffixed by a newline character.


Field Summary
static String DEFAULT_MARKER
           
 
Constructor Summary
InterleavedReader(Reader reader)
           
InterleavedReader(String marker, Reader reader)
           
 
Method Summary
 void close()
           
 Object read()
          Returns the next value in the stream: either a String, a JsonElement, or null to indicate the end of the stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MARKER

public static final String DEFAULT_MARKER
See Also:
Constant Field Values
Constructor Detail

InterleavedReader

public InterleavedReader(Reader reader)

InterleavedReader

public InterleavedReader(String marker,
                         Reader reader)
Method Detail

read

public Object read()
            throws IOException
Returns the next value in the stream: either a String, a JsonElement, or null to indicate the end of the stream. Callers should use instanceof to inspect the return type.

Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2009-2011 Google, Inc.. All Rights Reserved.