Decrypting a hardcoded file as byte[]

后端 未结 2 972
执笔经年
执笔经年 2021-02-11 07:49

Well this is actually a two-parter...

First I need to

  1. read the contents of the file
  2. crypt them into a byte[]
  3. write the
2条回答
  •  长情又很酷
    2021-02-11 08:29

    The I/O aspect of your question is best addressed by reading the "Byte Streams" and "Buffered Streams" sections of the Oracle Java tutorial. You can accumulate the bytes in memory by writing them to a ByteArrayOutputStream, and then using the toByteArray() method to get the bytes as a byte[].

提交回复
热议问题