Tag: 解码器

获取特定像素的x,y位置

我遇到了一个问题,我得到了一个代码,它读取所有像素并获取像素的RGB颜色。 但在此之前,我将图片切成块,这样我也可以计算出更大的图像,而不会超出内存。 这是代码: Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED); try { decoder_image = BitmapRegionDecoder.newInstance(filePath, false); } catch (IOException e) { e.printStackTrace(); } try { boolean bool_pixel = true; final int width = decoder_image.getWidth(); final int height = decoder_image.getHeight(); // Divide the bitmap into 1100×1100 sized chunks and process it. // This makes sure that the app will not be “overloaded” […]

如何在Java中解码DER编码的字符串?

我正在尝试从数字证书中读取自定义扩展程序。 我知道值是在DER中编码的GeneralString。 有没有一种简单的方法来正确解码它并获得Java String? 我尝试了以下内容,但是’s’包含了一些编码元数据作为字符串开头的垃圾字符。 byte[] ext = cert.getExtensionValue(“1.2.3.4”); String s= new String(ext); System.out.println(s); 有没有快速简便的方法来做到这一点? 或者我真的需要使用一些完整的ASN.1库吗? 谢谢!