opendap/src/main/java/opendap/dap/BytePrimitiveVector.java
public synchronized void deserialize(DataInputStream source,
                                         ServerVersion sv,
                                         StatusUI statusUI)
            throws IOException, EOFException, DataReadException {

        int modFour = vals.length % 4;
        // number of bytes to pad
        int pad = (modFour != 0) ? (4 - modFour) : 0;

        for (int i = 0; i < vals.length; i++) {
            vals[i] = source.readByte();
            if (statusUI != null) {
                statusUI.incrementByteCount(1);
                if (statusUI.userCancelled())
                    throw new DataReadException("User cancelled");
            }
        }
        // pad out to a multiple of four bytes
        byte unused;
        for (int i = 0; i < pad; i++)
            unused = source.readByte();
        if (statusUI != null)
            statusUI.incrementByteCount(pad);
    }
public synchronized void deserialize(DataInputStream source,
                                         ServerVersion sv,
                                         StatusUI statusUI)
            throws IOException, EOFException, DataReadException {

        int modFour = vals.length % 4;
        // number of bytes to pad
        int pad = (modFour != 0) ? (4 - modFour) : 0;

        for (int i = 0; i < vals.length; i++) {
            vals[i] = source.readByte();
            if (statusUI != null) {
                statusUI.incrementByteCount(1);
                if (statusUI.userCancelled())
                    throw new DataReadException("User cancelled");
            }
        }
        // pad out to a multiple of four bytes
        byte unused;
        for (int i = 0; i < pad; i++)
            unused = source.readByte();
        if (statusUI != null)
            statusUI.incrementByteCount(pad);
    }
public synchronized void deserialize ( DataInputStream source , ServerVersion sv , StatusUI statusUI ) throws IOException , EOFException , DataReadException { int modFour = vals . length % 4 ; // number of bytes to pad
 int pad = ( modFour != 0 ) ? ( 4 - modFour ) : 0 ; for ( int i = 0 ; i < vals . length ; i ++ ) { vals [ i ] = source . readByte ( ) ; if ( statusUI != null ) { statusUI . incrementByteCount ( 1 ) ; if ( statusUI . userCancelled ( ) ) throw new DataReadException ( "User cancelled" ) ; } } // pad out to a multiple of four bytes
 byte unused ; for ( int i = 0 ; i < pad ; i ++ ) unused = source . readByte ( ) ; if ( statusUI != null ) statusUI . incrementByteCount ( pad ) ; }
Reads data from a <code>DataInputStream</code>. This method is only used
on the client side of the OPeNDAP client/server connection.

@param source   a <code>DataInputStream</code> to read from.
@param sv       The <code>ServerVersion</code> returned by the server.
(used by <code>DSequence</code> to determine which protocol version was
used).
@param statusUI The <code>StatusUI</code> object to use for GUI updates
and user cancellation notification (may be null).
@throws DataReadException when invalid data is read, or if the user
cancels the download.
@throws EOFException      if EOF is found before the variable is completely
deserialized.
@throws IOException       thrown on any other InputStream exception.
@see ClientIO#deserialize(DataInputStream, ServerVersion, StatusUI)
Reads data from a <code > DataInputStream< / code > . This method is only used on the client side of the OPeNDAP client / server connection .