com.codetaco.funnel.provider.FixedLengthInputCache Maven / Gradle / Ivy
package com.codetaco.funnel.provider;
import java.io.IOException;
import java.io.InputStream;
import com.codetaco.funnel.parameters.FunnelContext;
/**
*
* FixedLengthInputCache class.
*
*
* @author Chris DeGreef [email protected]
*/
public class FixedLengthInputCache extends AbstractInputCache
{
/**
*
* Constructor for FixedLengthInputCache.
*
*
* @param _context a {@link com.codetaco.funnel.parameters.FunnelContext}
* object.
* @param _source a {@link java.io.InputStream} object.
* @throws java.io.IOException if any.
*/
public FixedLengthInputCache(final FunnelContext _context, final InputStream _source) throws IOException
{
super(_context, _source);
}
@Override
void postOpenVerification() throws IOException
{
if (length() % context.getFixedRecordLengthIn() != 0)
throw new IOException("file size ("
+ length()
+ ") not even multiple of record size ("
+ context.getFixedRecordLengthIn()
+ ")");
}
}