Coverage Report - org.apache.giraph.utils.ExtendedByteArrayDataInput
 
Classes in this File Line Coverage Branch Coverage Complexity
ExtendedByteArrayDataInput
0%
0/25
0%
0/2
1
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one
 3  
  * or more contributor license agreements.  See the NOTICE file
 4  
  * distributed with this work for additional information
 5  
  * regarding copyright ownership.  The ASF licenses this file
 6  
  * to you under the Apache License, Version 2.0 (the
 7  
  * "License"); you may not use this file except in compliance
 8  
  * with the License.  You may obtain a copy of the License at
 9  
  *
 10  
  *     http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15  
  * See the License for the specific language governing permissions and
 16  
  * limitations under the License.
 17  
  */
 18  
 package org.apache.giraph.utils;
 19  
 
 20  
 import java.io.ByteArrayInputStream;
 21  
 import java.io.DataInput;
 22  
 import java.io.DataInputStream;
 23  
 import java.io.IOException;
 24  
 
 25  
 /**
 26  
  * Provides access to a internals of ByteArrayInputStream
 27  
  */
 28  
 public class ExtendedByteArrayDataInput extends ByteArrayInputStream
 29  
   implements ExtendedDataInput {
 30  
   /** Internal data input */
 31  
   private final DataInput dataInput;
 32  
   /**
 33  
    * Constructor
 34  
    *
 35  
    * @param buf Buffer to read
 36  
    */
 37  
   public ExtendedByteArrayDataInput(byte[] buf) {
 38  0
     super(buf);
 39  0
     dataInput = new DataInputStream(this);
 40  0
   }
 41  
 
 42  
   /**
 43  
    * Get access to portion of a byte array
 44  
    *
 45  
    * @param buf Byte array to access
 46  
    * @param offset Offset into the byte array
 47  
    * @param length Length to read
 48  
    */
 49  
   public ExtendedByteArrayDataInput(byte[] buf, int offset, int length) {
 50  0
     super(buf, offset, length);
 51  0
     dataInput = new DataInputStream(this);
 52  0
   }
 53  
 
 54  
   @Override
 55  
   public int getPos() {
 56  0
     return pos;
 57  
   }
 58  
 
 59  
   @Override
 60  
   public boolean endOfInput() {
 61  0
     return available() == 0;
 62  
   }
 63  
 
 64  
   @Override
 65  
   public void readFully(byte[] b) throws IOException {
 66  0
     dataInput.readFully(b);
 67  0
   }
 68  
 
 69  
   @Override
 70  
   public void readFully(byte[] b, int off, int len) throws IOException {
 71  0
     dataInput.readFully(b, off, len);
 72  0
   }
 73  
 
 74  
   @Override
 75  
   public int skipBytes(int n) throws IOException {
 76  0
     return dataInput.skipBytes(n);
 77  
   }
 78  
 
 79  
   @Override
 80  
   public boolean readBoolean() throws IOException {
 81  0
     return dataInput.readBoolean();
 82  
   }
 83  
 
 84  
   @Override
 85  
   public byte readByte() throws IOException {
 86  0
     return dataInput.readByte();
 87  
   }
 88  
 
 89  
   @Override
 90  
   public int readUnsignedByte() throws IOException {
 91  0
     return dataInput.readUnsignedByte();
 92  
   }
 93  
 
 94  
   @Override
 95  
   public short readShort() throws IOException {
 96  0
     return dataInput.readShort();
 97  
   }
 98  
 
 99  
   @Override
 100  
   public int readUnsignedShort() throws IOException {
 101  0
     return dataInput.readUnsignedShort();
 102  
   }
 103  
 
 104  
   @Override
 105  
   public char readChar() throws IOException {
 106  0
     return dataInput.readChar();
 107  
   }
 108  
 
 109  
   @Override
 110  
   public int readInt() throws IOException {
 111  0
     return dataInput.readInt();
 112  
   }
 113  
 
 114  
   @Override
 115  
   public long readLong() throws IOException {
 116  0
     return dataInput.readLong();
 117  
   }
 118  
 
 119  
   @Override
 120  
   public float readFloat() throws IOException {
 121  0
     return dataInput.readFloat();
 122  
   }
 123  
 
 124  
   @Override
 125  
   public double readDouble() throws IOException {
 126  0
     return dataInput.readDouble();
 127  
   }
 128  
 
 129  
   @Override
 130  
   public String readLine() throws IOException {
 131  0
     return dataInput.readLine();
 132  
   }
 133  
 
 134  
   @Override
 135  
   public String readUTF() throws IOException {
 136  0
     return dataInput.readUTF();
 137  
   }
 138  
 }