You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2012/05/25 14:51:23 UTC
svn commit: r1342603 -
/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java
Author: ggregory
Date: Fri May 25 12:51:23 2012
New Revision: 1342603
URL: http://svn.apache.org/viewvc?rev=1342603&view=rev
Log:
Sort members in AB order.
Modified:
commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java
Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java?rev=1342603&r1=1342602&r2=1342603&view=diff
==============================================================================
--- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java (original)
+++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java Fri May 25 12:51:23 2012
@@ -47,22 +47,27 @@ class SmbFileRandomAccessContent extends
rafis = new InputStream()
{
@Override
- public int read() throws IOException
+ public int available() throws IOException
{
- return raf.readByte();
+ long available = raf.length() - raf.getFilePointer();
+ if (available > Integer.MAX_VALUE)
+ {
+ return Integer.MAX_VALUE;
+ }
+
+ return (int) available;
}
@Override
- public long skip(long n) throws IOException
+ public void close() throws IOException
{
- raf.seek(raf.getFilePointer() + n);
- return n;
+ raf.close();
}
@Override
- public void close() throws IOException
+ public int read() throws IOException
{
- raf.close();
+ return raf.readByte();
}
@Override
@@ -78,15 +83,10 @@ class SmbFileRandomAccessContent extends
}
@Override
- public int available() throws IOException
+ public long skip(long n) throws IOException
{
- long available = raf.length() - raf.getFilePointer();
- if (available > Integer.MAX_VALUE)
- {
- return Integer.MAX_VALUE;
- }
-
- return (int) available;
+ raf.seek(raf.getFilePointer() + n);
+ return n;
}
};
}
@@ -104,18 +104,19 @@ class SmbFileRandomAccessContent extends
}
}
- public long getFilePointer() throws IOException
+ public void close() throws IOException
{
- return raf.getFilePointer();
+ raf.close();
}
- public void seek(long pos) throws IOException
+ public long getFilePointer() throws IOException
{
- raf.seek(pos);
+ return raf.getFilePointer();
}
- public void setLength(long newLength) throws IOException {
- raf.setLength(newLength);
+ public InputStream getInputStream() throws IOException
+ {
+ return rafis;
}
public long length() throws IOException
@@ -123,9 +124,9 @@ class SmbFileRandomAccessContent extends
return raf.length();
}
- public void close() throws IOException
+ public boolean readBoolean() throws IOException
{
- raf.close();
+ return raf.readBoolean();
}
public byte readByte() throws IOException
@@ -148,19 +149,19 @@ class SmbFileRandomAccessContent extends
return raf.readFloat();
}
- public int readInt() throws IOException
+ public void readFully(byte b[]) throws IOException
{
- return raf.readInt();
+ raf.readFully(b);
}
- public int readUnsignedByte() throws IOException
+ public void readFully(byte b[], int off, int len) throws IOException
{
- return raf.readUnsignedByte();
+ raf.readFully(b, off, len);
}
- public int readUnsignedShort() throws IOException
+ public int readInt() throws IOException
{
- return raf.readUnsignedShort();
+ return raf.readInt();
}
public long readLong() throws IOException
@@ -173,41 +174,45 @@ class SmbFileRandomAccessContent extends
return raf.readShort();
}
- public boolean readBoolean() throws IOException
+ public int readUnsignedByte() throws IOException
{
- return raf.readBoolean();
+ return raf.readUnsignedByte();
}
- public int skipBytes(int n) throws IOException
+ public int readUnsignedShort() throws IOException
{
- return raf.skipBytes(n);
+ return raf.readUnsignedShort();
}
- public void readFully(byte b[]) throws IOException
+ public String readUTF() throws IOException
{
- raf.readFully(b);
+ return raf.readUTF();
}
- public void readFully(byte b[], int off, int len) throws IOException
+ public void seek(long pos) throws IOException
{
- raf.readFully(b, off, len);
+ raf.seek(pos);
}
- public String readUTF() throws IOException
+ public void setLength(long newLength) throws IOException {
+ raf.setLength(newLength);
+ }
+
+ public int skipBytes(int n) throws IOException
{
- return raf.readUTF();
+ return raf.skipBytes(n);
}
@Override
- public void writeDouble(double v) throws IOException
+ public void write(byte b[]) throws IOException
{
- raf.writeDouble(v);
+ raf.write(b);
}
@Override
- public void writeFloat(float v) throws IOException
+ public void write(byte b[], int off, int len) throws IOException
{
- raf.writeFloat(v);
+ raf.write(b, off, len);
}
@Override
@@ -217,63 +222,63 @@ class SmbFileRandomAccessContent extends
}
@Override
- public void writeByte(int v) throws IOException
+ public void writeBoolean(boolean v) throws IOException
{
- raf.writeByte(v);
+ raf.writeBoolean(v);
}
@Override
- public void writeChar(int v) throws IOException
+ public void writeByte(int v) throws IOException
{
- raf.writeChar(v);
+ raf.writeByte(v);
}
@Override
- public void writeInt(int v) throws IOException
+ public void writeBytes(String s) throws IOException
{
- raf.writeInt(v);
+ raf.writeBytes(s);
}
@Override
- public void writeShort(int v) throws IOException
+ public void writeChar(int v) throws IOException
{
- raf.writeShort(v);
+ raf.writeChar(v);
}
@Override
- public void writeLong(long v) throws IOException
+ public void writeChars(String s) throws IOException
{
- raf.writeLong(v);
+ raf.writeChars(s);
}
@Override
- public void writeBoolean(boolean v) throws IOException
+ public void writeDouble(double v) throws IOException
{
- raf.writeBoolean(v);
+ raf.writeDouble(v);
}
@Override
- public void write(byte b[]) throws IOException
+ public void writeFloat(float v) throws IOException
{
- raf.write(b);
+ raf.writeFloat(v);
}
@Override
- public void write(byte b[], int off, int len) throws IOException
+ public void writeInt(int v) throws IOException
{
- raf.write(b, off, len);
+ raf.writeInt(v);
}
@Override
- public void writeBytes(String s) throws IOException
+ public void writeLong(long v) throws IOException
{
- raf.writeBytes(s);
+ raf.writeLong(v);
}
@Override
- public void writeChars(String s) throws IOException
+ public void writeShort(int v) throws IOException
{
- raf.writeChars(s);
+ raf.writeShort(v);
}
@Override
@@ -282,9 +287,4 @@ class SmbFileRandomAccessContent extends
raf.writeUTF(str);
}
- public InputStream getInputStream() throws IOException
- {
- return rafis;
- }
-
}