/** Creates a new input bit stream wrapping a given byte array. * * @param a the byte array to wrap. */ public InputBitStream(final byte[] a) { is = NullInputStream.getInstance(); repositionableStream = null; fileChannel = null; if (a.length > 0) { buffer = a; avail = a.length; wrapping = true; noBuffer = false; } else { // A zero-length buffer is like having no buffer buffer = null; avail = 0; wrapping = false; noBuffer = true; } }
/** Returns an input stream encapsulating a nonempty fragment of an array of input streams. * * @param inputStream an array of input streams, that will be encapsulated. * @param offset the first input stream that will be encapsulated. * @param length the number of input streams to be encapsulated. * @return an input stream encapsulating the argument streams (the only argument, if length is 1). */ public static InputStream getStream( final InputStream[] inputStream, final int offset, final int length ) { if ( length == 0 ) return NullInputStream.getInstance(); if ( length == 1 ) return inputStream[ offset ]; return new MultipleInputStream( inputStream, offset ,length ); }
/** Returns an input stream encapsulating a nonempty fragment of an array of input streams. * * @param inputStream an array of input streams, that will be encapsulated. * @param offset the first input stream that will be encapsulated. * @param length the number of input streams to be encapsulated. * @return an input stream encapsulating the argument streams (the only argument, if length is 1). */ public static InputStream getStream(final InputStream[] inputStream, final int offset, final int length) { if (length == 0) return NullInputStream.getInstance(); if (length == 1) return inputStream[offset]; return new MultipleInputStream(inputStream, offset ,length); }
/** Returns an input stream encapsulating a nonempty fragment of an array of input streams. * * @param inputStream an array of input streams, that will be encapsulated. * @param offset the first input stream that will be encapsulated. * @param length the number of input streams to be encapsulated. * @return an input stream encapsulating the argument streams (the only argument, if length is 1). */ public static InputStream getStream( final InputStream[] inputStream, final int offset, final int length ) { if ( length == 0 ) return NullInputStream.getInstance(); if ( length == 1 ) return inputStream[ offset ]; return new MultipleInputStream( inputStream, offset ,length ); }
private InputStream getStreamFromResultSet( final ResultSet rs, final MutableString title ) throws SQLException { final InputStream[] a = new InputStream[ rs.getMetaData().getColumnCount() - 2 ]; // -2 for id and title for( int i = 0; i < a.length; i++ ) { a[ i ] = rs.getBinaryStream( i + 3 ); if ( a[ i ] == null ) a[ i ] = NullInputStream.getInstance(); } if ( title != null ) title.replace( rs.getString( 2 ) ); return MultipleInputStream.getStream( a ); }
private InputStream getStreamFromResultSet( final ResultSet rs, final MutableString title ) throws SQLException { final InputStream[] a = new InputStream[ rs.getMetaData().getColumnCount() - 2 ]; // -2 for id and title for( int i = 0; i < a.length; i++ ) { a[ i ] = rs.getBinaryStream( i + 3 ); if ( a[ i ] == null ) a[ i ] = NullInputStream.getInstance(); } if ( title != null ) title.replace( rs.getString( 2 ) ); return MultipleInputStream.getStream( a ); }
private InputStream getStreamFromResultSet( final ResultSet rs, final MutableString title ) throws SQLException { final InputStream[] a = new InputStream[ rs.getMetaData().getColumnCount() - 2 ]; // -2 for id and title for( int i = 0; i < a.length; i++ ) { a[ i ] = rs.getBinaryStream( i + 3 ); if ( a[ i ] == null ) a[ i ] = NullInputStream.getInstance(); } if ( title != null ) title.replace( rs.getString( 2 ) ); return MultipleInputStream.getStream( a ); }
private InputStream getStreamFromResultSet( final ResultSet rs, final MutableString title ) throws SQLException { final InputStream[] a = new InputStream[ rs.getMetaData().getColumnCount() - 2 ]; // -2 for id and title for( int i = 0; i < a.length; i++ ) { a[ i ] = rs.getBinaryStream( i + 3 ); if ( a[ i ] == null ) a[ i ] = NullInputStream.getInstance(); } if ( title != null ) title.replace( rs.getString( 2 ) ); return MultipleInputStream.getStream( a ); }
throw new IllegalArgumentException(); is = NullInputStream.getInstance(); repositionableStream = null; fileChannel = null;
throw new IllegalArgumentException(); is = NullInputStream.getInstance(); repositionableStream = null; fileChannel = null;
final Document fakeDocument = factory.getDocument( NullInputStream.getInstance(), Reference2ObjectMaps.EMPTY_MAP );
final Document fakeDocument = factory.getDocument( NullInputStream.getInstance(), Reference2ObjectMaps.EMPTY_MAP );
final Document fakeDocument = factory.getDocument( NullInputStream.getInstance(), Reference2ObjectMaps.EMPTY_MAP );
final Document fakeDocument = factory.getDocument( NullInputStream.getInstance(), Reference2ObjectMaps.EMPTY_MAP );
final Document fakeDocument = factory.getDocument( NullInputStream.getInstance(), Reference2ObjectMaps.EMPTY_MAP );