/*
 * 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.IOException;

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

/**
 * Implements the DataOutput part of the RandomAccessContent interface and throws
 * UnsupportedOperationException if one of those methods are called.
 * (for read-only random access implementations)
 */
public abstract class AbstractRandomAccessContent implements RandomAccessContent
{
    private final RandomAccessMode mode;

    protected AbstractRandomAccessContent(final RandomAccessMode mode)
    {
        this.mode = mode;
    }

    public void writeDouble(double v) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void writeFloat(float v) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void write(int b) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void writeByte(int v) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void writeChar(int v) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void writeInt(int v) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void writeShort(int v) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void writeLong(long v) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void writeBoolean(boolean v) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void write(byte[] b) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void write(byte[] b, int off, int len) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void writeBytes(String s) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void writeChars(String s) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    public void writeUTF(String str) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    /**
     * @deprecated see {@link java.io.DataInputStream#readLine()} This method will be removed when it is
     * removed from the DataInput interface this class implements (which will probably never happen).
     * @return The line as a String.
     * @throws IOException if an error occurs.
     */
    @Deprecated
    public String readLine() throws IOException
    {
        throw new UnsupportedOperationException("deprecated");
    }
}

@@ -1426,40 +1426,481 @@
     
-public void writeDouble(double v
+/**%0A     * @deprecated see %7B@link java.io.DataInputStream#readLine()%7D This method will be removed when it is%0A     * removed from the DataInput interface this class implements (which will probably never happen).%0A     * @return The line as a String.%0A     * @throws IOException if an error occurs.%0A     */%0A    @Deprecated%0A    public String readLine() throws IOException%0A    %7B%0A        throw new UnsupportedOperationException(%22deprecated%22);%0A    %7D%0A%0A    public void write(byte%5B%5D b
 ) th
@@ -2005,21 +2005,35 @@
 rite
-Float(float v
+(byte%5B%5D b, int off, int len
 ) th
@@ -2251,131 +2251,22 @@
 iteB
-yte(int v) throws IOException%0A    %7B%0A        throw new UnsupportedOperationException();%0A    %7D%0A%0A    public void writeChar(int
+oolean(boolean
  v) 
@@ -2373,11 +2373,12 @@
 rite
-Int
+Byte
 (int
@@ -2489,19 +2489,22 @@
 rite
-Short(int v
+Bytes(String s
 ) th
@@ -2609,17 +2609,16 @@
 rite
-Long(long
+Char(int
  v) 
@@ -2721,33 +2721,30 @@
 id write
-Boolean(boolean v
+Chars(String s
 ) throws
@@ -2837,33 +2837,39 @@
 c void write
-(byte%5B%5D b
+Double(double v
 ) throws IOE
@@ -2966,35 +2966,21 @@
 rite
-(byte%5B%5D b, int off, int len
+Float(float v
 ) th
@@ -3077,38 +3077,33 @@
 c void write
-Bytes(String s
+Int(int v
 ) throws IOE
@@ -3192,38 +3192,35 @@
 c void write
-Chars(String s
+Long(long v
 ) throws IOE
@@ -3317,22 +3317,19 @@
 rite
-UTF(String str
+Short(int v
 ) th
@@ -3417,354 +3417,39 @@
     
-/**%0A     * @deprecated see %7B@link java.io.DataInputStream#readLine()%7D This method will be removed when it is%0A     * removed from the DataInput interface this class implements (which will probably never happen).%0A     * @return The line as a String.%0A     * @throws IOException if an error occurs.%0A     */%0A    @Deprecated%0A    public String readLine(
+public void writeUTF(String str
 ) th
@@ -3515,35 +3515,23 @@
 onException(
-%22deprecated%22
 );%0A    %7D%0A%7D%0A

Sort methods in AB-order.