@Override public Object[] readData( DataInputStream inputStream ) throws KettleFileException, SocketTimeoutException { lock.readLock().lock(); try { Object[] data = new Object[ size() ]; for ( int i = 0; i < size(); i++ ) { data[ i ] = getValueMeta( i ).readData( inputStream ); } if ( size() == 0 ) { try { inputStream.readBoolean(); } catch ( EOFException e ) { throw new KettleEOFException( e ); } catch ( SocketTimeoutException e ) { throw e; } catch ( IOException e ) { throw new KettleFileException( toString() + " : Unable to read the marker flag data from input stream", e ); } } return data; } finally { lock.readLock().unlock(); } }
public RowMeta( DataInputStream inputStream ) throws KettleFileException, SocketTimeoutException { this(); int nr; try { nr = inputStream.readInt(); } catch ( SocketTimeoutException e ) { throw e; } catch ( EOFException e ) { throw new KettleEOFException( "End of file while reading the number of metadata values in the row metadata", e ); } catch ( IOException e ) { throw new KettleFileException( "Unable to read nr of metadata values: " + e.toString(), e ); } for ( int i = 0; i < nr; i++ ) { try { int type = inputStream.readInt(); ValueMetaInterface valueMeta = ValueMetaFactory.createValueMeta( type ); valueMeta.readMetaData( inputStream ); addValueMeta( valueMeta ); } catch ( EOFException e ) { throw new KettleEOFException( e ); } catch ( Exception e ) { throw new KettleFileException( toString() + " : Unable to read row metadata from input stream", e ); } } }