<commit_before>/*
 * @(#) WritingDataInput.java
 * Created May 17, 2012 by oleg
 * (C) ONE, SIA
 */
package org.apache.cassandra.io.util;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.EOFException;
import java.io.IOException;

/**
 * Writes all data being read from this data input to supplied {@link DataOutput} object.
 * 
 * @author <NAME><<EMAIL>>
 *
 */
public class DataInputSink implements DataInput
{
    /**
     * all data read from here...
     */
    private final DataInput in;

    /**
     * ...will be written here
     */
    private final DataOutput out;

    public DataInputSink(DataInput in, DataOutput out)
    {
        this.in = in;
        this.out = out;
    }
    
    public void readFully(byte[] buf) throws IOException
    {
        readFully(buf,0,buf.length);
    }
    
    public void readFully(byte[] buf, int offs, int len) throws IOException
    {
        in.readFully(buf, offs, len);
        out.write(buf, offs, len);
    }
    
    public int skipBytes(int bytecount) throws IOException
    {
        for (int i=0;i<bytecount;i++)
        {
            try {
                int b=in.readUnsignedByte();
                out.writeByte(i);
            } catch (EOFException e) {
                return i;
            }
        }

        return bytecount;
    }
    
    public boolean readBoolean() throws IOException
    {
        boolean b = in.readBoolean();
        out.writeBoolean(b);
        return b;
    }
    
    public byte readByte() throws IOException<commit_msg>[cassandra] dont FullGC compacting large rows (OL-23087)<commit_after>/*
 * @(#) WritingDataInput.java
 * Created May 17, 2012 by oleg
 * (C) ONE, SIA
 */
package org.apache.cassandra.io.util;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.EOFException;
import java.io.IOException;

/**
 * Writes all data being read from this data input to supplied {@link DataOutput} object.
 * 
 * @author <NAME><<EMAIL>>
 *
 */
public class DataInputSink implements DataInput
{
    /**
     * all data read from here...
     */
    private final DataInput in;

    /**
     * ...will be written here
     */
    private final DataOutput out;

    public DataInputSink(DataInput in, DataOutput out)
    {
        this.in = in;
        this.out = out;
    }
    
    public void readFully(byte[] buf) throws IOException
    {
        readFully(buf,0,buf.length);
    }
    
    public void readFully(byte[] buf, int offs, int len) throws IOException
    {
        in.readFully(buf, offs, len);
        out.write(buf, offs, len);
    }
    
    public int skipBytes(int bytecount) throws IOException
    {
        for (int i=0;i<bytecount;i++)
        {
            try {
                int b=in.readUnsignedByte();
                out.writeByte(b);
            } catch (EOFException e) {
                return i;
            }
        }

        return bytecount;
    }
    
    public boolean readBoolean() throws IOException
    {
        boolean b = in.readBoolean();
        out.writeBoolean(b);
        return b;
    }
    
    public byte readByte() throws IOException
{'fraction_non_alphanumeric': 0.10854947166186359, 'fraction_numerical': 0.0067243035542747355, 'mean_word_length': 1.9809160305343512, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2400310', 'n_tokens_mistral': 971, 'n_tokens_neox': 941, 'n_words': 259}