mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-10-04 11:26:44 -04:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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()));
|
||||
}
|
||||
|
Reference in New Issue
Block a user