git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274941 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -1,7 +1,7 @@ | |||
| /* | |||
| * The Apache Software License, Version 1.1 | |||
| * | |||
| * Copyright (c) 2002 The Apache Software Foundation. All rights | |||
| * Copyright (c) 2002-2003 The Apache Software Foundation. All rights | |||
| * reserved. | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without | |||
| @@ -125,6 +125,16 @@ public class StringInputStream | |||
| } | |||
| } | |||
| /** | |||
| * Reads from the Stringreader into a byte array | |||
| * | |||
| * @param b the byte array to read into | |||
| * @param off the offset in the byte array | |||
| * @param len the length in the byte array to fill | |||
| * @return the actual number read into the byte array, -1 at | |||
| * the end of the stream | |||
| * @exception IOException if an error occurs | |||
| */ | |||
| public synchronized int read(byte[] b, int off, int len) | |||
| throws IOException { | |||
| @@ -176,6 +186,10 @@ public class StringInputStream | |||
| } | |||
| /** | |||
| * @return the current number of bytes ready for reading | |||
| * @exception IOException if an error occurs | |||
| */ | |||
| public synchronized int available() throws IOException { | |||
| if (in == null) { | |||
| throw new IOException("Stream Closed"); | |||
| @@ -190,6 +204,9 @@ public class StringInputStream | |||
| } | |||
| } | |||
| /** | |||
| * @return false - mark is not supported | |||
| */ | |||
| public boolean markSupported () { | |||
| return false; // would be imprecise | |||
| } | |||
| @@ -98,6 +98,7 @@ public final class ChainReaderHelper { | |||
| /** | |||
| * Sets the primary reader | |||
| * @param rdr the reader object | |||
| */ | |||
| public final void setPrimaryReader(Reader rdr) { | |||
| primaryReader = rdr; | |||
| @@ -105,6 +106,7 @@ public final class ChainReaderHelper { | |||
| /** | |||
| * Set the project to work with | |||
| * @param project the current project | |||
| */ | |||
| public final void setProject(final Project project) { | |||
| this.project = project; | |||
| @@ -112,6 +114,8 @@ public final class ChainReaderHelper { | |||
| /** | |||
| * Get the project | |||
| * | |||
| * @return the current project | |||
| */ | |||
| public final Project getProject() { | |||
| return project; | |||
| @@ -120,6 +124,7 @@ public final class ChainReaderHelper { | |||
| /** | |||
| * Sets the buffer size to be used. Defaults to 4096, | |||
| * if this method is not invoked. | |||
| * @param size the buffer size to use | |||
| */ | |||
| public final void setBufferSize(int size) { | |||
| bufferSize = size; | |||
| @@ -127,6 +132,8 @@ public final class ChainReaderHelper { | |||
| /** | |||
| * Sets the collection of filter reader sets | |||
| * | |||
| * @param fchain the filter chains collection | |||
| */ | |||
| public final void setFilterChains(Vector fchain) { | |||
| filterChains = fchain; | |||
| @@ -134,6 +141,8 @@ public final class ChainReaderHelper { | |||
| /** | |||
| * Assemble the reader | |||
| * @return the assembled reader | |||
| * @exception BuildException if an error occurs | |||
| */ | |||
| public final Reader getAssembledReader() throws BuildException { | |||
| if (primaryReader == null) { | |||
| @@ -249,6 +258,9 @@ public final class ChainReaderHelper { | |||
| /** | |||
| * Read data from the reader and return the | |||
| * contents as a string. | |||
| * @param rdr the reader object | |||
| * @return the contents of the file as a string | |||
| * @exception IOException if an error occurs | |||
| */ | |||
| public final String readFully(Reader rdr) | |||
| throws IOException { | |||
| @@ -1,7 +1,7 @@ | |||
| /* | |||
| * The Apache Software License, Version 1.1 | |||
| * | |||
| * Copyright (c) 2002 The Apache Software Foundation. All rights | |||
| * Copyright (c) 2002-2003 The Apache Software Foundation. All rights | |||
| * reserved. | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without | |||
| @@ -72,6 +72,10 @@ public final class JavaClassHelper { | |||
| /** | |||
| * Get the constants declared in a file as name=value | |||
| * | |||
| * @param bytes the class as a array of bytes | |||
| * @return a StringBuffer contains the name=value pairs | |||
| * @exception IOException if an error occurs | |||
| */ | |||
| public static final StringBuffer getConstants(byte[] bytes) | |||
| throws IOException { | |||