?
Solved

Codes of Java access binary file

Posted on 1998-07-08
1
Medium Priority
?
159 Views
Last Modified: 2012-05-04
I want use Java to display different font like chinese ttf file.
Can we retrieve font pixel map from the binary file of TTF?
How can we get the binary like C language fgetc or fread?
If you answer me,I will be happy and thank you.
0
Comment
Question by:mathematics
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
msmolyak earned 80 total points
ID: 1225605
Reading files is easy. You can use either RandomAccessFile or DataInputStream on top of FileInputStream. E.g.

public static final int BUFFER_SIZE = 4096;

File tiffFile = new File("image.tif");
DataInputStream tiffStream = new DataInputStream(new FileInputStream(tiffFile));

byte[] buffer = new byte[BUFFER_SIZE];

int bytesRead;
while ((bytesRead = tiffStream.read(buffer)) >= 0)
{
  // Process data buffer
}
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month15 days, 11 hours left to enroll

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question