// Path: libraries/core/src/main/java/com/paritytrading/nassau/MessageListener.java
// public interface MessageListener {
// 
//     /**
//      * Receive a message. The message is contained in the buffer between the
//      * current position and the limit.
//      *
//      * @param buffer a buffer
//      * @throws IOException if an I/O error occurs
//      */
//     void message(ByteBuffer buffer) throws IOException;
// 
// }


import static com.paritytrading.foundation.ByteBuffers.*;
import com.paritytrading.nassau.MessageListener;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.util.zip.GZIPInputStream;
/*
 * Copyright 2014 Nassau authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.paritytrading.nassau.binaryfile;



/**
 * An implementation of a BinaryFILE reader.
 */
public class BinaryFILEReader implements Closeable {

    private static final int BUFFER_SIZE = 128 * 1024;

    private static final int GZIP_BUFFER_SIZE = 64 * 1024;

    private final ReadableByteChannel channel;

// Path: libraries/core/src/main/java/com/paritytrading/nassau/MessageListener.java
// public interface MessageListener {
// 
//     /**
//      * Receive a message. The message is contained in the buffer between the
//      * current position and the limit.
//      *
//      * @param buffer a buffer
//      * @throws IOException if an I/O error occurs
//      */
//     void message(ByteBuffer buffer) throws IOException;
// 
// }


// Path: libraries/core/src/main/java/com/paritytrading/nassau/binaryfile/BinaryFILEReader.java
import static com.paritytrading.foundation.ByteBuffers.*;
import com.paritytrading.nassau.MessageListener;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.util.zip.GZIPInputStream;

/*
 * Copyright 2014 Nassau authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.paritytrading.nassau.binaryfile;



/**
 * An implementation of a BinaryFILE reader.
 */
public class BinaryFILEReader implements Closeable {

    private static final int BUFFER_SIZE = 128 * 1024;

    private static final int GZIP_BUFFER_SIZE = 64 * 1024;

    private final ReadableByteChannel channel;

    private final MessageListener listener;