我有一个位图,想通过将其编码为base64发送到服务器,但我不想压缩png或jpeg中的图像。
现在我之前所做的是:
ByteArrayOutputStream byteArrayBitmapStream = new ByteArrayOutputStream();
bitmapPicture.compress(Bitmap.CompressFormat.PNG, COMPRESSION_QUALITY, byteArrayBitmapStream);
byte[] b = byteArrayBitmapStream.toByteArray();
//then simple encoding to base64 and off to server
encodedImage = Base64.encodeToString(b, Base64.NO_WRAP);
现在我不想使用任何压缩或格式,只想使用从位图获取的普通简单的byte[]编码并发送到服务器。
有什么指针吗?