diff options
Diffstat (limited to 'javaunohelper/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java')
-rw-r--r-- | javaunohelper/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/javaunohelper/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java b/javaunohelper/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java index 59ed553b3272..f143bf82f12a 100644 --- a/javaunohelper/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java +++ b/javaunohelper/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -30,31 +30,31 @@ import java.io.IOException; import com.sun.star.io.XInputStream; import java.io.InputStream; -/** The <code>InputStreamToInputXStreamAdapter</code> wraps the - Java <code>InputStream</code> object into a - UNO <code>XInputStream</code> object. - This allows users to access an <code>InputStream</code> +/** The <code>InputStreamToInputXStreamAdapter</code> wraps the + Java <code>InputStream</code> object into a + UNO <code>XInputStream</code> object. + This allows users to access an <code>InputStream</code> as if it were an <code>XInputStream</code>. */ public class InputStreamToXInputStreamAdapter implements XInputStream { - /** + /** * Internal store to the InputStream */ private InputStream iIn; - + /** * Constructor. * - * @param in The <code>XInputStream</code> to be + * @param in The <code>XInputStream</code> to be * accessed as an <code>InputStream</code>. */ - public InputStreamToXInputStreamAdapter (InputStream in) + public InputStreamToXInputStreamAdapter (InputStream in) { iIn = in; } - public int available() throws + public int available() throws com.sun.star.io.IOException { @@ -69,8 +69,8 @@ public class InputStreamToXInputStreamAdapter implements XInputStream { return(bytesAvail); } - public void closeInput() throws - com.sun.star.io.IOException + public void closeInput() throws + com.sun.star.io.IOException { try { iIn.close(); @@ -79,8 +79,8 @@ public class InputStreamToXInputStreamAdapter implements XInputStream { } } - public int readBytes(byte[][] b, int len) throws - com.sun.star.io.IOException + public int readBytes(byte[][] b, int len) throws + com.sun.star.io.IOException { int count = 0; try { @@ -92,22 +92,22 @@ public class InputStreamToXInputStreamAdapter implements XInputStream { bytesRead = iIn.read(b[0], 0, len); } // Casting bytesRead to an int is okay, since the user can - // only pass in an integer length to read, so the bytesRead + // only pass in an integer length to read, so the bytesRead // must <= len. // if (bytesRead <= 0) { return(0); - } + } return ((int)bytesRead); - - + + } catch (IOException e) { throw new com.sun.star.io.IOException("reader error: "+e.toString()); } } - public int readSomeBytes(byte[][] b, int len) throws - com.sun.star.io.IOException + public int readSomeBytes(byte[][] b, int len) throws + com.sun.star.io.IOException { int count = 0; try { @@ -119,22 +119,22 @@ public class InputStreamToXInputStreamAdapter implements XInputStream { bytesRead = iIn.read(b[0], 0, len); } // Casting bytesRead to an int is okay, since the user can - // only pass in an integer length to read, so the bytesRead + // only pass in an integer length to read, so the bytesRead // must <= len. // if (bytesRead <= 0) { return(0); - } + } return ((int)bytesRead); - - + + } catch (IOException e) { throw new com.sun.star.io.IOException("reader error: "+e.toString()); } } - public void skipBytes(int n) throws - com.sun.star.io.IOException + public void skipBytes(int n) throws + com.sun.star.io.IOException { int avail; int tmpLongVal = n; @@ -154,7 +154,7 @@ public class InputStreamToXInputStreamAdapter implements XInputStream { tmpIntVal = (int)tmpLongVal; } tmpLongVal -= tmpIntVal; - + try { iIn.skip(tmpIntVal); } catch (IOException e) { |