uk.ac.starlink.util
Class IOUtils

java.lang.Object
  |
  +--uk.ac.starlink.util.IOUtils

public class IOUtils
extends Object

Provides static methods which do miscellaneous input/output tasks.


Constructor Summary
IOUtils()
           
 
Method Summary
static void skip(InputStream strm, long nskip)
          Skips over a number of bytes in an InputStream This is implemented using InputStream.skip(long) but differs from it in that it guarantees to skip the bytes as specified, or to throw an exception.
static void skipBytes(DataInput strm, long nskip)
          Skips over a number of bytes in a DataInput.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOUtils

public IOUtils()
Method Detail

skipBytes

public static void skipBytes(DataInput strm,
                             long nskip)
                      throws IOException
Skips over a number of bytes in a DataInput. This is implemented using DataInput.skipBytes(int) but differs from it in that it guarantees to skip the bytes as specified, or to throw an exception.

Parameters:
strm - the stream to skip through
nskip - the number of bytes to skip
Throws:
EOFException - if the end of file is reached
IOException - if an I/O error occurs
IllegalArgumentException - if nskip<0

skip

public static void skip(InputStream strm,
                        long nskip)
                 throws IOException
Skips over a number of bytes in an InputStream This is implemented using InputStream.skip(long) but differs from it in that it guarantees to skip the bytes as specified, or to throw an exception.

Parameters:
strm - the stream to skip through
nskip - the number of bytes to skip
Throws:
EOFException - if the end of file is reached
IOException - if an I/O error occurs
IllegalArgumentException - if nskip<0

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.