/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 org.apache.commons.vfs2.provider;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.vfs2.util.RandomAccessMode;

/**
 * Implements the part usable for all stream base random access implementations.
 */
public abstract class AbstractRandomAccessStreamContent extends AbstractRandomAccessContent
{
    protected AbstractRandomAccessStreamContent(final RandomAccessMode mode)
    {
        super(mode);
    }

    protected abstract DataInputStream getDataInputStream() throws IOException;

    public byte readByte() throws IOException
    {
        byte data = getDataInputStream().readByte();
        return data;
    }

    public char readChar() throws IOException
    {
        char data = getDataInputStream().readChar();
        return data;
    }

    public double readDouble() throws IOException
    {
        double data = getDataInputStream().readDouble();
        return data;
    }

    public float readFloat() throws IOException
    {
        float data = getDataInputStream().readFloat();
        return data;
    }

    public int readInt() throws IOException
    {
        int data = getDataInputStream().readInt();
        return data;
    }

    public int readUnsignedByte() throws IOException
    {
        int data = getDataInputStream().readUnsignedByte();
        return data;
    }

    public int readUnsignedShort() throws IOException
    {
        int data = getDataInputStream().readUnsignedShort();
        return data;
    }

    public long readLong() throws IOException
    {
        long data = getDataInputStream().readLong();
        return data;
    }

    public short readShort() throws IOException
    {
        short data = getDataInputStream().readShort();
        return data;
    }

    public boolean readBoolean() throws IOException
    {
        boolean data = getDataInputStream().readBoolean();
        return data;
    }

    public int skipBytes(int n) throws IOException
    {
        int data = getDataInputStream().skipBytes(n);
        return data;
    }

    public void readFully(byte[] b) throws IOException
    {
        getDataInputStream().readFully(b);
    }

    public void readFully(byte[] b, int off, int len) throws IOException
    {
        getDataInputStream().readFully(b, off, len);
    }

    public String readUTF() throws IOException
    {
        String data = getDataInputStream().readUTF();
        return data;
    }

    public InputStream getInputStream() throws IOException
    {
        return getDataInputStream();
    }
}

@@ -1422,19 +1422,14 @@
     
-byte data =
+return
  get
@@ -1458,37 +1458,16 @@
 Byte();%0A
-        return data;%0A
     %7D%0A%0A 
@@ -1529,19 +1529,14 @@
     
-char data =
+return
  get
@@ -1565,37 +1565,16 @@
 Char();%0A
-        return data;%0A
     %7D%0A%0A 
@@ -1640,21 +1640,14 @@
     
-double data =
+return
  get
@@ -1678,37 +1678,16 @@
 uble();%0A
-        return data;%0A
     %7D%0A%0A 
@@ -1751,20 +1751,14 @@
     
-float data =
+return
  get
@@ -1788,37 +1788,16 @@
 loat();%0A
-        return data;%0A
     %7D%0A%0A 
@@ -1849,34 +1849,30 @@
   %7B%0A        
-int data =
+return
  getDataInpu
@@ -1892,37 +1892,16 @@
 dInt();%0A
-        return data;%0A
     %7D%0A%0A 
@@ -1962,34 +1962,30 @@
   %7B%0A        
-int data =
+return
  getDataInpu
@@ -2014,37 +2014,16 @@
 Byte();%0A
-        return data;%0A
     %7D%0A%0A 
@@ -2085,34 +2085,30 @@
   %7B%0A        
-int data =
+return
  getDataInpu
@@ -2138,37 +2138,16 @@
 hort();%0A
-        return data;%0A
     %7D%0A%0A 
@@ -2209,19 +2209,14 @@
     
-long data =
+return
  get
@@ -2245,37 +2245,16 @@
 Long();%0A
-        return data;%0A
     %7D%0A%0A 
@@ -2318,20 +2318,14 @@
     
-short data =
+return
  get
@@ -2355,37 +2355,16 @@
 hort();%0A
-        return data;%0A
     %7D%0A%0A 
@@ -2432,22 +2432,14 @@
     
-boolean data =
+return
  get
@@ -2471,37 +2471,16 @@
 lean();%0A
-        return data;%0A
     %7D%0A%0A 
@@ -2547,18 +2547,14 @@
     
-int data =
+return
  get
@@ -2585,37 +2585,16 @@
 tes(n);%0A
-        return data;%0A
     %7D%0A%0A 
@@ -2907,21 +2907,14 @@
     
-String data =
+return
  get
@@ -2946,29 +2946,8 @@
 ();%0A
-        return data;%0A
     

In-line temporary variables.