Merge branch 'master' into 3.0-structure

Conflicts:
	imageio/imageio-psd/pom.xml
	twelvemonkeys-imageio/pom.xml
	twelvemonkeys-servlet/pom.xml
This commit is contained in:
Erlend Hamnaberg
2010-01-29 19:27:10 +01:00
64 changed files with 3851 additions and 672 deletions

View File

@@ -60,6 +60,7 @@ public final class DecoderStream extends FilterInputStream {
* @see java.io.FilterInputStream#in
*/
public DecoderStream(final InputStream pStream, final Decoder pDecoder) {
// TODO: Let the decoder decide preferred buffer size
this(pStream, pDecoder, 1024);
}

View File

@@ -107,6 +107,7 @@ public final class PackBitsDecoder implements Decoder {
int read = 0;
final int max = pBuffer.length;
// TODO: Don't decode more than single runs, because some writers add pad bytes inside the stream...
while (read < max) {
int n;

View File

@@ -115,13 +115,7 @@ public class BASE64 {
return buf.toString();
}
/**
* Quick implementation, using the undocumented
* {@code sun.misc.BASE64Decoder.decodeBuffer(String)}.
*/
public static byte[] decode(String pData) throws java.io.IOException {
//return DECODER.decodeBuffer(pData);
public static byte[] decode(String pData) throws IOException {
InputStream in = new DecoderStream(new ByteArrayInputStream(pData.getBytes()), new Base64Decoder());
ByteArrayOutputStream bytes = new FastByteArrayOutputStream(pData.length() * 3);
FileUtil.copy(in, bytes);
@@ -131,7 +125,7 @@ public class BASE64 {
//private final static sun.misc.BASE64Decoder DECODER = new sun.misc.BASE64Decoder();
public static void main(String[] pArgs) throws java.io.IOException {
public static void main(String[] pArgs) throws IOException {
if (pArgs.length == 1) {
System.out.println(encode(pArgs[0].getBytes()));
}