// Path: src/main/java/au/edu/jcu/v4l4j/exceptions/StateException.java
// public class StateException extends RuntimeException {
// 
// 	private static final long serialVersionUID = 1351714754008657462L;
// 
// 	public StateException(String message) {
// 		super(message);
// 	}
// 
// 	public StateException(String message, Throwable throwable) {
// 		super(message, throwable);
// 	}
// 
// 	public StateException(Throwable throwable) {
// 		super(throwable);
// 	}
// }
// 
// Path: src/main/java/au/edu/jcu/v4l4j/exceptions/UnsupportedMethod.java
// public class UnsupportedMethod extends RuntimeException {
// 	private static final long serialVersionUID = -8801339441741012577L;
// 
// 	public UnsupportedMethod(String message) {
// 		super(message);
// 	}
// 
// 	public UnsupportedMethod(String message, Throwable throwable) {
// 		super(message, throwable);
// 	}
// 
// 	public UnsupportedMethod(Throwable throwable) {
// 		super(throwable);
// 	}
// }


import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.image.WritableRaster;
import au.edu.jcu.v4l4j.exceptions.StateException;
import au.edu.jcu.v4l4j.exceptions.UnsupportedMethod;
	
	/**
	 * This method is used by the owning frame grabber to get a reference
	 * to the byte array used to hold the frame data.
	 * @return the byte array used to hold the frame data
	 */
	final byte[] getByteArray() {
		return frameBuffer;
	}
	
	/**
	 * This method is used by the owning frame grabber to get the V4L2 buffer
	 * index
	 * @return the V4L2 buffer index
	 */
	final int getBufferInex() {
		return bufferIndex;
	}
	
	/**
	 * Subclasses can override this method to either
	 * return a {@link WritableRaster} for this video frame, or throw
	 * a {@link UnsupportedMethod} exception if this video frame cannot
	 * generate a {@link WritableRaster}.
	 * @return  a {@link WritableRaster}.
	 * @throws UnsupportedMethod exception if a raster cannot be generated
	 * for this video frame (because of its image format for instance) 
	 */
	protected WritableRaster refreshRaster() {
		if (raster == null)
// Path: src/main/java/au/edu/jcu/v4l4j/exceptions/StateException.java
// public class StateException extends RuntimeException {
// 
// 	private static final long serialVersionUID = 1351714754008657462L;
// 
// 	public StateException(String message) {
// 		super(message);
// 	}
// 
// 	public StateException(String message, Throwable throwable) {
// 		super(message, throwable);
// 	}
// 
// 	public StateException(Throwable throwable) {
// 		super(throwable);
// 	}
// }
// 
// Path: src/main/java/au/edu/jcu/v4l4j/exceptions/UnsupportedMethod.java
// public class UnsupportedMethod extends RuntimeException {
// 	private static final long serialVersionUID = -8801339441741012577L;
// 
// 	public UnsupportedMethod(String message) {
// 		super(message);
// 	}
// 
// 	public UnsupportedMethod(String message, Throwable throwable) {
// 		super(message, throwable);
// 	}
// 
// 	public UnsupportedMethod(Throwable throwable) {
// 		super(throwable);
// 	}
// }


// Path: src/main/java/au/edu/jcu/v4l4j/BaseVideoFrame.java
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.image.WritableRaster;
import au.edu.jcu.v4l4j.exceptions.StateException;
import au.edu.jcu.v4l4j.exceptions.UnsupportedMethod;

	
	/**
	 * This method is used by the owning frame grabber to get a reference
	 * to the byte array used to hold the frame data.
	 * @return the byte array used to hold the frame data
	 */
	final byte[] getByteArray() {
		return frameBuffer;
	}
	
	/**
	 * This method is used by the owning frame grabber to get the V4L2 buffer
	 * index
	 * @return the V4L2 buffer index
	 */
	final int getBufferInex() {
		return bufferIndex;
	}
	
	/**
	 * Subclasses can override this method to either
	 * return a {@link WritableRaster} for this video frame, or throw
	 * a {@link UnsupportedMethod} exception if this video frame cannot
	 * generate a {@link WritableRaster}.
	 * @return  a {@link WritableRaster}.
	 * @throws UnsupportedMethod exception if a raster cannot be generated
	 * for this video frame (because of its image format for instance) 
	 */
	protected WritableRaster refreshRaster() {
		if (raster == null)
			throw new UnsupportedMethod("A raster can not be generated for this "