org.neo4j.com
Class BlockLogReader

java.lang.Object
  extended by org.neo4j.com.BlockLogReader
All Implemented Interfaces:
Closeable, Channel, ReadableByteChannel

public class BlockLogReader
extends Object
implements ReadableByteChannel

The counterpart of BlockLogBuffer, sits on the receiving end and reads chunks of log. It is provided with a ChannelBuffer which feeds a series of chunks formatted as follows:

  • If the first byte is 0, then it is 256 bytes in total size (including the first byte) AND there are more coming.
  • If the first byte is not 0, then its value cast as an integer is the total size of the chunk AND there are no more - the stream is complete

  • Constructor Summary
    BlockLogReader(org.jboss.netty.buffer.ChannelBuffer source)
               
     
    Method Summary
     void close()
               
     boolean isOpen()
               
     int read(ByteBuffer dst)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    BlockLogReader

    public BlockLogReader(org.jboss.netty.buffer.ChannelBuffer source)
    Method Detail

    isOpen

    public boolean isOpen()
    Specified by:
    isOpen in interface Channel

    close

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

    read

    public int read(ByteBuffer dst)
             throws IOException
    Specified by:
    read in interface ReadableByteChannel
    Throws:
    IOException


    Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.