Question: This is a Unit test Class below This is the code that puts that code to test but it wont work I get an invalid
This is a Unit test Class below
This is the code that puts that code to test but it wont work
I get an "invalid stream header: 50360A23" when testing the code I need help to fix please.
void readBinaryPNI() throws IOException \{ Pixel[][] expectedPixels = \{\{RED,GREEN,BLUE },{ YELLOW, WHITE, BLACK }; PNMImage expectedImage = new PNMImage ( format: "P6", comment: "RGB YWB", depth: 255, expectedPixels); PNMImage simpleBinaryImage = PNMImage.readBinaryPNM( fileName: "images/simple-binary.pnm"); assertEquals(expectedImage, simpleBinaryImage); \} 2usages public static PNMImage readBinaryPNM(String fileName) throws IOException \{ // TODO Implement this method PNMImage image = null; try\{ ObjectInputStream ois = new objectInputStream(new FileInputStream(fileName)); image = (PNMImage) ois.readobject(); \}catch (ClassNotFoundException e) \{ e.printStackTrace(); \} return image
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
